export default (function () {
  window.NGR_PREFER_CANVAS = !0;
  var define, module, exports;
  return function t(e, i, n) {
    function o(s, a) {
      if (!i[s]) {
        if (!e[s]) {
          var h = "function" == typeof require && require;
          if (!a && h)return h(s, !0);
          if (r)return r(s, !0);
          throw new Error("Cannot find module '" + s + "'")
        }
        var l = i[s] = {exports: {}};
        e[s][0].call(l.exports, function (t) {
          var i = e[s][1][t];
          return o(i ? i : t)
        }, l, l.exports, t, e, i, n)
      }
      return i[s].exports
    }

    for (var r = "function" == typeof require && require, s = 0; s < n.length; s++)o(n[s]);
    return o
  }({
    1: [function (t, e, i) {
      (function () {
        var i, n;
        n = t("q"), i = {}, i.mainPromise = n.all([]), i._imageCache = {}, i._patternCache = {}, i.loadImages = function (t) {
          var e;
          return i.mainPromise = n.all(function () {
            var n, o, r;
            for (r = [], n = 0, o = t.length; n < o; n++)e = t[n], r.push(i._loadImage(e));
            return r
          }())
        }, i._loadImage = function (t, e) {
          var o, r;
          return o = n.defer(), name in i._imageCache && o.resolve(i._imageCache[t]), r = new Image, r.addEventListener("load", function () {
            return o.resolve(i._imageCache[t] = r)
          }), r.addEventListener("error", function () {
            return console.error("Error loading " + t), o.reject()
          }), r.src = t, o.promise.nodeify(e)
        }, e.exports = i
      }).call(this)
    }, {q: 17}], 2: [function (t, e, i) {
      (function () {
        var i;
        i = t("../../third_party/leaflet/dist/ngr-src.js"), e.exports.Floor = i.Control.Floor = i.Control.extend({
          includes: [i.Mixin.Events],
          options: {position: "bottomleft"},
          initialize: function (t) {
            return this.floorMap = {}, i.Util.setOptions(this, t), this._onItemClick = function (t) {
              return function (e) {
                return e.preventDefault(), e.stopPropagation(), t.fire("change", {
                  from: t.currentFloor,
                  to: e.target.floor
                })
              }
            }(this)
          },
          onAdd: function (t) {
            var e, n;
            return this._map = t, e = "ngr-floor-switcher", n = this.options.className ? " " + this.options.className : "", this._container = i.DomUtil.create("div", e + " ngr-bar" + n), this._setFloorList(), this._setCurrentFloor(), this._container
          },
          onRemove: function (t) {
            return this._map = null
          },
          enable: function () {
            return i.DomUtil.removeClass(this._container, "disabled"), this
          },
          disable: function () {
            return i.DomUtil.addClass(this._container, "disabled"), this
          },
          setFloorList: function (t) {
            return this.floorList = t, this._setFloorList(), this
          },
          _setFloorList: function () {

            var t, e, n, o, r;
            if (this._map && this.floorList) {
              for (this.floorMap = {}; this._container.firstChild;)this._container.firstChild.removeEventListener("click", this._onItemClick), this._container.removeChild(this._container.firstChild);
              for (o = this.floorList, r = [], e = 0, n = o.length; e < n; e++)t = o[e], r.push(function (t) {
                return function (e) {
                  var n;
                  return n = i.DomUtil.create("a", "", t._container), n.innerHTML = e.address, n.href = "#", n.floor = e.id, n.addEventListener("click", t._onItemClick), t.floorMap[e.id] = n
                }
              }(this)(t));
              return r
            }
          },
          getCurrentFloor: function () {
            return this.currentFloor
          },
          setCurrentFloor: function (t, e) {
            return this.currentFloor = t, this._setCurrentFloor(), e && e(t), this
          },
          _setCurrentFloor: function () {
            var t, e, n, o;
            if (this._map) {
              n = this.floorMap[this.currentFloor], o = this.floorMap;
              for (e in o)t = o[e], i.DomUtil.removeClass(t, "selected");
              return n ? i.DomUtil.addClass(n, "selected") : void 0
            }
          }
        }), e.exports.floor = i.control.floor = function (t) {
          return new i.Control.Floor(t)
        }
      }).call(this)
    }, {"../../third_party/leaflet/dist/ngr-src.js": 22}], 3: [function (t, e, i) {
      (function () {
        var i;
        i = t("../third_party/leaflet/dist/ngr-src.js"), e.exports = i._coreMap = i.Map.extend({
          initialize: function (t, e) {
            var n;
            return i.Map.prototype.initialize.call(this, t, e), this.featureLayers = [], this.mainBounds = i.latLngBounds([]), n = "", this.logoControl = new i.Control.Attribution, this.on("zoomend", function () {
              return this.zoomDelta = this.getZoom() - this.initZoomLvl | 0
            }, this)
          }, addFeatureLayer: function (t) {
            return i.Map.prototype.addLayer.call(this, t), "Frame" === t.layerType && this.mainBounds.extend(t.getBounds()), this._fixedPointOnMap && "Frame" !== t.layerType || (this._meterPixelRatio = null, t.getBounds().isValid() && (this._fixedPointOnMap = t.getBounds().getCenter(), this._fixedPointOnMapOffsetOneMeter = i.CRS.EPSG3857.unproject(i.CRS.EPSG3857.project(this._fixedPointOnMap).add([1, 1])))), this.featureLayers.push(t)
          }, removeFeatureLayer: function (t) {
            return i.Map.prototype.removeLayer.call(this, t), this.featureLayers.slice(this.featureLayers.indexOf(t), 1)
          }, render: function () {
            return i.Cache.mainPromise.then(function (t) {
              return function () {
                return t.fitBounds(t.mainBounds, {animate: !1}), t.initZoomLvl = t.getZoom(), t.fire("renderend", {initZoom: t.initZoomLvl})
              }
            }(this)), this
          }, clear: function () {
            var t, e, n;
            n = this._layers;
            for (t in n)e = n[t], this.removeLayer(e);
            return this.featureLayers.length = 0, this.initZoomLvl = null, this.zoomDelta = null, this._fixedPointOnMap = null, this.mainBounds = i.latLngBounds([]), i.Cache._patternCache = {}
          }, setMinZoom: function (t) {
            return setTimeout(function (e) {
              return function () {
                return e.options.minZoom = t
              }
            }(this), 0), this
          }, setMaxZoom: function (t) {
            return setTimeout(function (e) {
              return function () {
                return e.options.maxZoom = t
              }
            }(this), 0), this
          }
        })
      }).call(this)
    }, {"../third_party/leaflet/dist/ngr-src.js": 22}], 4: [function (t, e, i) {
      (function () {
        var i;
        i = t("../third_party/leaflet/dist/ngr-src.js"), i.IO = t("./IO.js"), i.DataSource = function (t) {
          null == t && (t = {}), (t.appKey || t.AppKey) && (this._server = t.server || "https://yxys.io"// "http://localhost:8087" "http://47.92.31.84/demo1"
            , this._header = {})
        }, i.DataSource.prototype.requestRegions = function (t, e) {
          var n, o;
          return o = this._server + "/region", n = i.IO.fetch({
            data: t,
            url: o,
            onsuccess: JSON.parse,
            header: this._header
          }), n.nodeify(e)
        }, i.DataSource.prototype.requestMap = function (t, e) {
          var n, o;
          return o = this._server + "/map/" + t, n = i.IO.fetch({
            url: o,
            onsuccess: JSON.parse,
            header: this._header
          }), n.nodeify(e)
        }, i.DataSource.prototype.requestMaps = function (t, e) {
          var n, o;
          return o = this._server + "/floor/building_" + t + ".json", n = i.IO.fetch({
            data: '',
            url: o,
            onsuccess: JSON.parse,
            header: {}
          }), n.nodeify(e)
        }, i.DataSource.prototype.requestPlanarGraph = function (t, e) {
          var n, o;
          // return o = "http://47.92.31.84/demo/server/floor/" + t + ".json", n = i.IO.fetch({
          return o = this._server + "/floor/" + t + ".json", n = i.IO.fetch({
            url: o,
            onsuccess: JSON.parse,
            header: {}
            // header: this._header
          }), n.nodeify(e)
        }, i.DataSource.prototype.requestCategory = function (t, e) {
          var n, o;
          return o = this._server + "/category/" + t, n = i.IO.fetch({
            url: o,
            onsuccess: JSON.parse,
            header: this._header
          }), n.nodeify(e)
        }, i.DataSource.prototype.requestCategories = function (t, e) {
          var n, o;
          return o = this._server + "/category/list", n = i.IO.fetch({
            data: t,
            url: o,
            onsuccess: JSON.parse,
            header: this._header
          }), n.nodeify(e)
        }, i.DataSource.prototype.requestPOI = function (t, e) {
          var n, o;
          return o = this._server + "/poi/" + t, n = i.IO.fetch({
            url: o,
            onsuccess: JSON.parse,
            header: this._header
          }), n.nodeify(e)
        }, i.DataSource.prototype.requestPOIChildren = function (t, e) {
          var n, o;
          // return o = "http://47.92.31.84/demo/server/poi/" + t + "/children", n = i.IO.fetch({
          return o = this._server + "/floor/children", n = i.IO.fetch({
            url: o,
            onsuccess: JSON.parse,
            header: {}
          }), n.nodeify(e)
        }, i.DataSource.prototype.POISearch = function (t, e) {
          var n, o, r, s;
          r = this._server + "/poi/search";
          for (n in t)s = t[n], t[n] = s;
          return o = i.IO.fetch({
            method: "POST",
            data: t,
            url: r,
            onsuccess: JSON.parse,
            header: this._header
          }), o.nodeify(e)
        }, i.DataSource.prototype.searchPOIByCoord = function (t, e) {
          var n, o, r, s;
          r = this._server + "/poi/coord";
          for (n in t)s = t[n], t[n] = s;
          return o = i.IO.fetch({
            method: "POST",
            data: t,
            url: r,
            onsuccess: JSON.parse,
            header: this._header
          }), o.nodeify(e)
        }, i.DataSource.prototype.requestNavigation = function (t, e) {
          var n, o;
          return o = this._server + "/navi", n = i.IO.fetch({
            data: t,
            url: o,
            onsuccess: JSON.parse,
            header: this._header
          }), n.nodeify(e)
        }, i.DataSource.prototype.requestTransitNavigation = function (t, e) {
          var n, o;
          return o = this._server + "/navi/transit", n = i.IO.fetch({
            method: "POST",
            data: t,
            url: o,
            onsuccess: JSON.parse,
            header: this._header
          }), n.nodeify(e)
        }, i.dataSource = function (t) {
          return new i.DataSource(t)
        }, e.exports = {DataSource: i.DataSource, dataSource: i.dataSource}
      }).call(this)
    }, {"../third_party/leaflet/dist/ngr-src.js": 22, "./IO.js": 8}], 5: [function (t, e, i) {
      (function () {
        var i;
        i = t("../third_party/leaflet/dist/ngr-src.js"), i.DataUtils = {}, i.DataUtils.getOffset = function (t, e) {
          var i, n, o, r, s, a, h, l, u, c, p;
          if (!(t instanceof Array && e instanceof Array && t.length > 0 && e.length > 0))throw new Error("Invalid Input");
          for (i = 0, s = e.length; i < s; i++)if (r = e[i], "[object String]" !== Object.prototype.toString.call(r))throw new Error("Invalid Input");
          for (l = [], n = 0, a = t.length; n < a; n++) {
            if (c = t[n], l.push([]), "[object String]" !== Object.prototype.toString.call(c))throw new Error("Invalid Input");
            for (o = 0, h = e.length; o < h; o++)for (r = e[o], u = p = 0; u >= 0;)u = c.indexOf(r, p), p = u + r.length, u >= 0 && (l[l.length - 1].push(u), l[l.length - 1].push(p))
          }
          return l
        }, e.exports = i.DataUtils
      }).call(this)
    }, {"../third_party/leaflet/dist/ngr-src.js": 22}], 6: [function (_dereq_, module, exports) {
      (function () {
        var HeatmapOverlay, NGR;
        NGR = _dereq_("../third_party/leaflet/dist/ngr-src.js"), HeatmapOverlay = _dereq_("../plugins/leaflet-heatmap.js"), _dereq_("../plugins/NGR.LayerGroup.Collision.js"), module.exports.FeatureLayer = NGR.FeatureLayer = NGR.GeoJSON.extend({
          options: {styleConfig: {}},
          initialize: function (t, e) {
            var i, n;
            NGR.setOptions(this, e), n = e.layerType, t && (i = t.features || t[n].features), this.layerType = this.options.layerType || n, this.heatmap, this._layers = {}, this._featureLayers = {}, this._featureLabels = {}, this._prefetchTexture(), i && this.addData(i)
          },
          onAdd: function (t) {
            // this为featureLayer
            // layerGroup 被调用2次（无collision） 新增图层Group
            return NGR.GeoJSON.prototype.onAdd.call(this, t), this
          },
          _prefetchTexture: function () {
            var t, e, i, n, o, r, s, a, h, l, u;
            if (r = [], this.layerType in this.options.styleConfig) {
              if (a = this.options.styleConfig[this.layerType], l = a.type, t = a.common, e = a.filter, "texture" in t.style && r.push(t.style.texture.url), e)for (o = 0, s = e.length; o < s; o++) {
                i = e[o], h = i.values;
                for (u in h)n = h[u], "texture" in n && r.push(n.texture.url)
              }
              return r.length > 0 ? NGR.Cache.loadImages(r) : void 0
            }
          },
          _template: function (geojson, value) {
            var result;
            return "[object String]" !== Object.prototype.toString.call(value) ? value : (result = value.replace(/%(\S*?)%/g, function (match, p1) {
              return eval("this.properties." + p1)
            }.bind(geojson)), "null" === result || "undefined" === result ? null : result)
          },
          _parseStyle: function (t, e, i) {
            var n, o, r, s, a, h, l, u;
            i.mainStyle || (i.mainStyle = {});
            for (l in e)switch (u = e[l], l) {
              case"label":
                (n = i.mainStyle).label || (n.label = {}), i.labelStyle || (i.labelStyle = {});
                for (r in u)s = u[r], i.labelStyle[r] = this._template(t, s), i.mainStyle.label[r] = this._template(t, s);
                break;
              case"logo":
                (o = i.mainStyle).logo || (o.logo = {});
                for (a in u)h = u[a], i.mainStyle.logo[a] = this._template(t, h);
                break;
              case"texture":
                i.mainStyle.texture = u.url, i.mainStyle.textureSize = u.size, i.mainStyle.textureRotate = u.rotate, i.mainStyle.textureRepeat = u.repeat;
                break;
              default:
                i.mainStyle[l] = this._template(t, u)
            }
          },
          resetStyle: function (t) {
            return NGR.Util.extend(t.options, t.defaultOptions), this._setLayerStyle(t, this.options.style), this
          },
          configStyle: function (geojson) {
            var common, filter, filter_item, filter_property_style, filter_property_value, i, len, property_value, ref,
              ref1, ref2, style, type;
            if (!(this.options.styleConfig && this.layerType in this.options.styleConfig))return {};
            for (style = {}, ref = this.options.styleConfig[this.layerType], type = ref.type, common = ref.common, filter = ref.filter, type && "inherit" !== type && (style.preparedType = type), this._parseStyle(geojson, common.style, style), ref1 = filter || [], i = 0, len = ref1.length; i < len; i++)if (filter_item = ref1[i], property_value = eval("arguments[0].properties." + filter_item.property)) {
              ref2 = filter_item.values;
              for (filter_property_value in ref2)filter_property_style = ref2[filter_property_value], new RegExp(filter_property_value).test(property_value) && this._parseStyle(geojson, filter_property_style, style)
            }
            return style
          },
          addTo: function (t) {
            return t.addLayer(this), this
          },
          addData: function (t) {
            var e, i, n, o, r, s, a, h, l, u;
            if (i = NGR.Util.isArray(t) ? t : t.features) {
              for (n = 0, h = i.length; n < h; n++)e = i[n], (e.geometries || e.geometry || e.features || e.coordinates) && this.addData(e);
              return this
            }
            if ((!this.options.filter || this.options.filter(t)) && (a = this.geometryToLayer(t, this.options.pointToLayer, this.options.coordsToLatLng, this.options))) {
              a.feature = NGR.GeoJSON.asFeature(t), a.feature.properties && (r = a.feature.properties.id), this._featureLayers[r] = a, a.defaultOptions = a.options, this.resetStyle(a), this.options.onEachFeature && this.options.onEachFeature(t, a), this.addLayer(a), l = this._featureLabels, u = [];
              for (o in l)s = l[o], u.push(this.addLayer(s));
              return u
            }
          },
          addFeature: function (t) {
            return this.addData(t), this
          },
          removeFeature: function (t) {
            return this.removeFeatureById(t.properties.id)
          },
          removeFeatureById: function (t) {
            return t in this._featureLayers && (this.removeLayer(this._featureLayers[t]), delete this._featureLayers[t]), t in this._featureLabels && (this.removeLayer(this._featureLabels[t]), delete this._featureLabels[t]), this
          },
          getLayerByFeatureId: function (t) {
            return this._featureLayers[t]
          },
          getLabelByFeatureId: function (t) {
            return this._featureLabels[t]
          },
          clearLayers: function () {
            return NGR.GeoJSON.prototype.clearLayers.call(this), this._featureLabels = {}, this._featureLayers = {}, this
          },
          getBounds: function () {
            var t;
            return t = new NGR.LatLngBounds, this.eachLayer(function (e) {
              return t.extend(e instanceof NGR.Marker || e instanceof NGR.CanvasLabel || e instanceof NGR.Circle || e instanceof NGR.CanvasMarker ? e.getLatLng() : e.getBounds())
            }), t
          },
          geometryToLayer: function (t, e, i) {
            var n, o, r, s, a, h, l, u, c, p, d, f, _, m;
            switch (a = "Feature" === t.type ? t.geometry : t, s = a.coordinates, m = this.configStyle(t), i = i || this.coordsToLatLng, m.preparedType || a.type) {
              case"Point":
                return l = i(s), e ? e(t, l) : NGR.circle(l, m.mainStyle.radius || .8);
              case"MultiPoint":
                for (p = [], h = 0, d = s.length; h < d; h++)r = s[h], c = i(r), e ? p.push(e(t, c)) : m.mainStyle.url ? (m.mainStyle.icon = NGR.icon({
                  iconUrl: m.mainStyle.url,
                  iconSize: m.mainStyle.size
                }), p.push(new NGR.Marker(c, m.mainStyle))) : p.push(new NGR.Circle(c, m.mainStyle.radius || .8, m.mainStyle));
                return new NGR.FeatureGroup(p);
              case"LineString":
                if (n = this.coordsToLatLngs(s, 1, i), Object.prototype.toString.call("[object Array]" === n[0]))throw"Invalid GeoJSON Object";
                return NGR.polyline(u, m.mainStyle);
              case"MultiLineString":
                return u = this.coordsToLatLngs(s, 1, i), NGR.multiPolyline(u, m.mainStyle);
              case"Polygon":
                if (2 === s.length && !s[1].length)throw"Invalid GeoJSON Object";
                return u = this.coordsToLatLngs(s, 1, i), _ = NGR.polygon(u, m.mainStyle), "labelStyle" in m && (m.labelStyle.boundPolygon = _, this._featureLabels[t.properties.id] = NGR.canvaslabel(_.getCentroid(), m.labelStyle)), _;
              case"MultiPolygon":
                if (s.length < 2)throw"Invalid GeoJSON Object";
                return u = this.coordsToLatLngs(s, 2, i), f = NGR.multiPolygon(u, m.mainStyle);
              case"Icon":
                return l = i(s), m.mainStyle.icon = NGR.icon({
                  iconUrl: m.mainStyle.url,
                  iconSize: m.mainStyle.size
                }), delete m.mainStyle.url, delete m.mainStyle.size, NGR.canvasmarker(l, m.mainStyle);
              case"Heatmap":
                return l = i(s), this.heatmap || (this.heatmap = new HeatmapOverlay(m.mainStyle)), this.heatmap.addData({
                  lat: l.lat,
                  lng: l.lng
                }), this.heatmap;
              case"Annotation":
                if ("Polygon" === a.type) {
                  if (2 === s.length && !s[1].length)throw"Invalid GeoJSON Object";
                  return u = this.coordsToLatLngs(s, 1, i), _ = NGR.polygon(u), c = _.getCentroid(), L.PolyUtil.PolygonContainsLatLng(_, c) || (c = _.getInnerPoint()), m.mainStyle.label && m.mainStyle.label.textContent || m.mainStyle.logo && m.mainStyle.logo.url ? (o = NGR.canvaslogolabel(c, m.mainStyle), !t.properties.common_area && t.properties.logo || (o._commonArea = !0), o) : null
                }
                if ("Point" === a.type) {
                  if (2 !== s.length)throw"Invalid GeoJSON Object";
                  return c = i(s), o = NGR.canvaslogolabel(c, m.mainStyle)
                }
                throw"Invalid GeoJSON Object";
              default:
                throw"Not a supported or invalid GeoJSON object."
            }
          },
          coordsToLatLng: function (t) {
            return NGR.CRS.EPSG3857.unproject(NGR.point(t))
          },
          coordsToLatLngs: function (t, e, i) {
            var n, o, r, s;
            for (s = [], o = 0, r = t.length; o < r; o++)n = t[o], e ? s.push(this.coordsToLatLngs(n, e - 1, i)) : s.push((i || this.coordsToLatLng)(n));
            return s
          }
        }), module.exports.featureLayer = function (t, e) {
          return new NGR.FeatureLayer(t, e)
        }
      }).call(this)
    }, {
      "../plugins/NGR.LayerGroup.Collision.js": 19,
      "../plugins/leaflet-heatmap.js": 20,
      "../third_party/leaflet/dist/ngr-src.js": 22
    }], 7: [function (t, e, i) {
      (function () {
        var i;
        i = t("../third_party/leaflet/dist/ngr-src.js"), i.FeatureLayerUtils = {}, i.FeatureLayerUtils.getInnerPointByLayer = function (t) {
          if (t instanceof i.Polygon)return t.getInnerPoint()
        }, i.FeatureLayerUtils.getInnerPointByLayerAndPOIId = function (t, e) {
          var n;
          if (t._featureLayers && t._featureLayers[e] && t._featureLayers[e]._latlngs)return n = i.polygon(t._featureLayers[e]._latlngs), i.FeatureLayerUtils.getInnerPointByLayer(n)
        }, e.exports = i.FeatureLayerUtils
      }).call(this)
    }, {"../third_party/leaflet/dist/ngr-src.js": 22}], 8: [function (t, e, i) {
      (function () {
        var i, n;
        n = t("q"), i = {}, i.IO = {}, i.IO.fetch = function (t, e) {
          var i, o, r, s, a, h, l, u, c, p, d, f, _, m, g, y, v;
          u = null != (d = t.method) ? d : "GET", m = t.url, i = null == (f = t.async) || f, r = t.data, h = t.header, o = null != (_ = t.contentType) ? _ : "application/json", p = t.onsuccess, c = t.onerror, s = n.defer(), v = new window.XMLHttpRequest, "GET" === u && r && (m += "?" + function () {
              var t;
              t = [];
              for (l in r)y = r[l], t.push(encodeURIComponent(l) + "=" + encodeURIComponent(y));
              return t
            }().join("&")), v.addEventListener("progress", function (t) {
            return t.lengthComputable ? s.notify({
              predictable: !0,
              percentage: t.loaded / t.total,
              loaded: t.loaded
            }) : s.notify({predictable: !1, loaded: t.loaded})
          }, !1), v.addEventListener("load", function () {
            return this.readyState === this.DONE && 200 === this.status ? s.resolve(p ? p(this.responseText) : this.responseText) : (c && c(this.readyState, this.status), s.reject(this.readyState, this.status))
          }, !1), v.addEventListener("error", function () {
            return c && c(this.readyState, this.status), s.reject(this.readyState, this.status)
          }, !1), v.addEventListener("abort", function () {
            return c && c(this.readyState, this.status), s.reject(this.readyState, this.status)
          }, !1), v.open(u, m, i);
          for (a in h)g = h[a], v.setRequestHeader(a, g);
          return "POST" !== u && "PUT" !== u || v.setRequestHeader("Content-Type", o), "GET" === u ? v.send(null) : "POST" === u && v.send(JSON.stringify(r)), s.promise.nodeify(e)
        }, e.exports = i.IO
      }).call(this)
    }, {q: 17}], 9: [function (t, e, i) {
      (function () {
        var i, n, o, r, s;
        o = t("../third_party/leaflet/dist/ngr-src.js"), r = t("./View.js"), i = t("./DataSource_new.js"), o.IO = t("./IO.js"), n = t("./Controls/Control.Floor.js"), s = t("./FeatureLayer.js"), t("../plugins/NGR.LayerGroup.Collision.js"), o.QuickRender = function (t, e) {
          var a, h, l, u, c, p, d, f;
          if (!t || !e)throw new Error("Invalid mapId or appKey");
          return window.map = new r.View("map", {appKey: e}), window.res = new i.DataSource({appKey: e}), window.layers = {}, d = null, p = null, l = null, f = function (t) {
            return console.error(t, t.stack)
          }, u = function (t) {
            return l && l.getContainer() && (map.removeControl(l), l = null), res.requestPOIChildren(t).then(function (t) {
              var e, i, o, r;
              for (i = [], o = 0, r = t.length; o < r; o++)e = t[o], "FLOOR" === e.type && i.push(e);
              return l = new n.Floor, l.on("change", function (t) {
                return l.setCurrentFloor(t.to, c)
              }), map.addControl(l), l.setFloorList(i), l.setCurrentFloor(i[0].id, c)
            }).fail(f)
          }, c = function (t) {
            return res.requestPlanarGraph(t).then(function (t) {
              return o.IO.fetch({url: "./style.json", onsuccess: JSON.parse}).then(function (e) {
                return d = e, map.clear(), layers.frame = s.featureLayer(t, {
                  layerType: "Frame",
                  styleConfig: e
                }), layers.area = s.featureLayer(t, {
                  layerType: "Area",
                  styleConfig: e
                }), layers.annotation = s.featureLayer(t.Area, {
                  layerType: "LogoLabel",
                  styleConfig: e
                }), layers.facility = s.featureLayer(t.Facility, {
                  layerType: "Facility",
                  styleConfig: e
                }), layers.collision = o.layerGroup.collision({margin: 0.01}), layers.collision.addLayer(layers.annotation), layers.collision.addLayer(layers.facility), map.addLayer(layers.frame), map.addLayer(layers.area), map.addLayer(layers.collision), map.render()
              }).fail(f)
            }).fail(f)
          }, h = function () {
            if (p)return l && l.getContainer() && (map.removeControl(l), l = null), c(p)
          }, a = new n.Floor({className: "building-control"}), a.on("change", function (t) {
            var e;
            return e = null, e = t.to === p ? h : u, a.setCurrentFloor(t.to, e)
          }), res.requestMap(t).then(function (t) {
            return p = t.poi, res.requestPOI(p).then(function (t) {
              if ("BUILDING" === t.type)return u(t.id);
              if ("PLANAR_GRAPH" === t.type)return res.requestPOIChildren(p).then(function (t) {
                var e, i, n, o;
                for (map.addControl(a), e = [], e.push({
                  id: p,
                  address: "总览"
                }), n = 0, o = t.length; n < o; n++)i = t[n], "BUILDING" === i.type && e.push(i);
                return a.setFloorList(e), a.setCurrentFloor(p, h)
              }).fail(f);
              throw new Error("Invalid poi type")
            }).fail(f)
          }).fail(f)
        }, e.exports.quickRender = o.QuickRender
      }).call(this)
    }, {
      "../plugins/NGR.LayerGroup.Collision.js": 19,
      "../third_party/leaflet/dist/ngr-src.js": 22,
      "./Controls/Control.Floor.js": 2,
      "./DataSource_new.js": 4,
      "./FeatureLayer.js": 6,
      "./IO.js": 8,
      "./View.js": 13
    }], 10: [function (t, e, i) {
      (function () {
        var i, n;
        n = t("../../third_party/leaflet/dist/ngr-src.js"), n.IO = t("../IO.js"), i = t("../../third_party/rtls-js/bleLocationEngine.js"), e.exports.BeaconLocationEngine = n.Class.extend({
          initialize: function (t) {
            return this.bleLoactionEngine_ = void 0
          }, fetchBeaconConfig: function (t) {
            var e;
            return !(!t.appKey || !t.mapId) && (e = {}, e.appKey = t.appKey, e.mapId = t.mapId, n.IO.fetch({
                data: e,
                url: t.server || "https://yxys.io/beacons",
                onsuccess: JSON.parse
              }))
          }, initBeaconConfig: function (t, e) {
            var n;
            return n = {}, n.BeaconsCfgArray = t, n = JSON.stringify(n), this.bleLocationEngine_ = new i(n, e)
          }, locate: function (t) {
            var e;
            return this.bleLocationEngine_ ? (e = {}, e.BeaconsArray = t, e = JSON.stringify(e), this.bleLocationEngine_.locate(e)) : null
          }, getBleLocationInfo: function () {
            return JSON.parse(this.bleLocationEngine_.getBleLocationInfo())
          }
        })
      }).call(this)
    }, {
      "../../third_party/leaflet/dist/ngr-src.js": 22,
      "../../third_party/rtls-js/bleLocationEngine.js": 23,
      "../IO.js": 8
    }], 11: [function (t, e, i) {
      (function () {
        var i;
        i = t("../../third_party/leaflet/dist/ngr-src.js"), e.exports.LocationProvider = i.Class.extend({
          includes: [i.Mixin.Events],
          statics: {MAC: "MAC", IP: "IP", UUID: "UUID", TAG: "TAG", PLANAR_GRAPH: "PLANAR_GRAPH"},
          options: {server: "https://yxys.io/pos", timeout: 3e4},
          initialize: function (t) {
            return i.Util.setOptions(this, t), this.planar = {}, this.idPool = {}, null != t && (t.appKey || t.AppKey) && (this.appKey = t.appKey || t.AppKey), null != t && t.sceneId && (this.sceneId = t.sceneId), this.runningIdReq = !1, this.runningPlanarReq = !1, this.cooldownTime = 1e3, this.currentIdType = null
          },
          watch: function (t, e, n) {
            switch (t) {
              case i.LocationProvider.MAC:
              case i.LocationProvider.IP:
              case i.LocationProvider.UUID:
              case i.LocationProvider.TAG:
                this.currentIdType || (this.currentIdType = t), this.currentIdType === t ? (0 === Object.keys(this.idPool).length && (this.runIdReq = !0), this.idPool[e] = {
                  scheduleId: null,
                  feature: {}
                }, n && (this.appKey = n)) : console.warn("(LocationProvider) Watch failed: mismatch current id type.");
                break;
              case i.LocationProvider.PLANAR_GRAPH:
                this.planar.id || (this.runPlanarReq = !0), this.planar.id = e, this.planar.features = {};
                break;
              default:
                console.error("Not a valid location type.")
            }
            return this
          },
          unwatch: function (t, e) {
            switch (t) {
              case i.LocationProvider.MAC:
              case i.LocationProvider.IP:
              case i.LocationProvider.UUID:
              case i.LocationProvider.TAG:
                e in this.idPool && (clearTimeout(this.idPool[e].scheduleId), delete this.idPool[e]), 0 === Object.keys(this.idPool).length && (this.runIdReq = !1, this.currentIdType = null);
                break;
              case i.LocationProvider.PLANAR_GRAPH:
                e === this.planar.id && (clearTimeout(this.planar.scheduleId), delete this.planar.id, delete this.planar.features, this.runPlanarReq = !1);
                break;
              default:
                console.error("Not a valid location type.")
            }
            return this
          },
          start: function () {
            return 0 !== Object.keys(this.idPool).length && (this.runIdReq = !0), this.planar.id && (this.runPlanarReq = !0), this._loop(), this
          },
          terminate: function () {
            return this.runIdReq = !1, this.runPlanarReq = !1, this
          },
          _loop: function () {
            var t, e;
            if (!this.runningIdReq && this.runIdReq && (this.runningIdReq = !0, (t = function (e) {
                return function () {
                  return e._createIdRequest().then(function () {
                    if (1e3 !== e.cooldownTime && (e.cooldownTime = 1e3), e.runIdReq)return t()
                  }).fail(function () {
                    return setTimeout(function () {
                      if (e.runIdReq)return t()
                    }, e.cooldownTime *= 2)
                  })
                }
              }(this))()), !this.runningPlanarReq && this.runPlanarReq)return this.runningPlanarReq = !0, (e = function (t) {
              return function () {
                return t._createPlanarRequest().then(function () {
                  if (1e3 !== t.cooldownTime && (t.cooldownTime = 1e3), t.runPlanarReq)return e()
                }).fail(function () {
                  return setTimeout(function () {
                    if (t.runPlanarReq)return e()
                  }, t.cooldownTime *= 2)
                })
              }
            }(this))()
          },
          _createIdRequest: function () {
            var t;
            return t = {}, t.idType = this.currentIdType, t.idDatas = Object.keys(this.idPool).join(","), this.appKey && (t.appKey = this.appKey), i.IO.fetch({
              url: this.options.server,
              data: t,
              onsuccess: JSON.parse
            }).then(function (t) {
              return function (e) {
                var n, o, r, s, a;
                if (s = function (e) {
                    var n, o, r, s;
                    switch (o = i.CRS.EPSG3857.unproject(e.geometry.coordinates), e.geometry.coordinates[0] = o.lat, e.geometry.coordinates[1] = o.lng, n = e.properties.id_data, t._mergePointFeature(t.idPool[n].feature, e), s = function () {
                      return t.idPool[n].feature.properties.status = "OUT", t.idPool[n].scheduleId = null, t.fire("out", t.idPool[n].feature)
                    }, e.properties.status) {
                      case"ENTER":
                        return t.idPool[n].scheduleId ? clearTimeout(t.idPool[n].scheduleId) : r = !0, t.idPool[n].scheduleId = setTimeout(s, e.properties.expires_in || t.options.timeout), t.fire(r ? "enter" : "move", t.idPool[n].feature);
                      case"MOVE":
                        return t.idPool[n].scheduleId ? clearTimeout(t.idPool[n].scheduleId) : r = !0, t.idPool[n].scheduleId = setTimeout(s, e.properties.expires_in || t.options.timeout), t.fire(r ? "enter" : "move", t.idPool[n].feature);
                      case"OUT":
                        return "To be continue...";
                      case"HEART_BEAT":
                        return t.idPool[n].scheduleId ? clearTimeout(t.idPool[n].scheduleId) : (t.idPool[n].feature.properties.status = "ENTER", t.fire("enter", t.idPool[n].feature)), t.idPool[n].scheduleId = setTimeout(s, e.properties.expires_in || t.options.timeout);
                      default:
                        return console.error("Unknown location status.")
                    }
                  }, "Feature" === e.type) s(e); else if ("FeatureCollection" === e.type)for (a = e.features, o = 0, r = a.length; o < r; o++)n = a[o], s(n)
              }
            }(this))
          },
          _createPlanarRequest: function () {
            var t;
            return t = {floorId: this.planar.id}, this.appKey && (t.appKey = this.appKey), this.sceneId && (t.sceneId = this.sceneId), i.IO.fetch({
              url: this.options.server,
              data: t,
              onsuccess: JSON.parse
            }).then(function (t) {
              return function (e) {
                var n, o, r, s, a;
                if (s = function (e) {
                    var n, o, r, s;
                    switch (o = i.CRS.EPSG3857.unproject(e.geometry.coordinates), e.geometry.coordinates[0] = o.lat, e.geometry.coordinates[1] = o.lng, n = e.properties.id_data, t.planar.features[n] || (t.planar.features[n] = {}, r = !0), t._mergePointFeature(t.planar.features[n], e), s = function () {
                      if (e.properties.status = "OUT", "features" in t.planar) {
                        if (!(n in t.planar.features))throw new Error("New feature has OUT status");
                        delete t.planar.features[n]
                      }
                      return t.fire("out", e)
                    }, e.properties.status) {
                      case"ENTER":
                        return t.planar.features[n].scheduleId && clearTimeout(t.planar.features[n].scheduleId), t.planar.features[n].scheduleId = setTimeout(s, e.properties.expires_in || t.options.timeout), t.fire(r ? "enter" : "move", t.planar.features[n]);
                      case"MOVE":
                        return t.planar.features[n].scheduleId && clearTimeout(t.planar.features[n].scheduleId), t.planar.features[n].scheduleId = setTimeout(s, e.properties.expires_in || t.options.timeout), t.fire(r ? "enter" : "move", t.planar.features[n]);
                      case"OUT":
                        return "To be continue...";
                      case"HEART_BEAT":
                        return t.planar.features[n].scheduleId ? clearTimeout(t.planar.features[n].scheduleId) : (t.planar.features[n].properties.status = "ENTER", t.fire("enter", t.planar.features[n])), t.planar.features[n].scheduleId = setTimeout(s, e.properties.expires_in || t.options.timeout);
                      default:
                        return console.error("Unknown location status.")
                    }
                  }, "Feature" === e.type) s(e); else if ("FeatureCollection" === e.type)for (a = e.features, o = 0, r = a.length; o < r; o++)n = a[o], s(n)
              }
            }(this))
          },
          _mergePointFeature: function (t, e) {
            var i, n;
            t.type = e.type, t.properties || (t.properties = {});
            for (n in t.properties)t.properties[n] = e.properties[n];
            for (n in e.properties)t.properties[n] = e.properties[n];
            return t.geometry || (t.geometry = {}), t.geometry.type = e.geometry.type, (i = t.geometry).coordinates || (i.coordinates = []), t.geometry.coordinates[0] = e.geometry.coordinates[0], t.geometry.coordinates[1] = e.geometry.coordinates[1]
          }
        }), e.exports.locationProvider = function (t) {
          return new i.LocationProvider(t)
        }
      }).call(this)
    }, {"../../third_party/leaflet/dist/ngr-src.js": 22}], 12: [function (t, e, i) {
      (function () {
        var i;
        i = t("../../third_party/leaflet/dist/ngr-src.js"), e.exports.NavigationProvider = i.Class.extend({
          options: {
            server: "https://yxys.io",
            floor_height: 2.6
          }, initialize: function (t) {
            i.Util.setOptions(this, t), this.fromPoint = null, this.fromFloor = null, this.destPoint = null, this.destFloor = null, this._navigations = null, this._planarGraphOrder = null
          }, setFrom: function (t, e) {
            return this.fromFloor = e, this.fromPoint = i.CRS.EPSG3857.project(i.latLng(t)), this
          }, setDestination: function (t, e) {
            return this.destFloor = e, this.destPoint = i.CRS.EPSG3857.project(i.latLng(t)), this
          }, navigate: function (t) {
            var e;
            if (e = new i.DataSource({
                appKey: this.options.appKey || this.options.AppKey,
                server: this.options.server
              }), this.fromPoint && this.destPoint)return e.requestNavigation({
              to_x: this.destPoint.x,
              to_y: this.destPoint.y,
              from_x: this.fromPoint.x,
              from_y: this.fromPoint.y,
              to_planar_graph: this.destFloor,
              from_planar_graph: this.fromFloor
            }).then(function (t) {
              return function (e) {
                return t._parseRawRoutines(e.features), t._rawRoutines = e.features
              }
            }(this)).nodeify(t)
          }, transitNavitage: function (t, e) {
            var n, o, r, s, a;
            if (!(t instanceof Array))throw new Error("Invalid Transit Points");
            for (o = 0, r = t.length; o < r; o++)if (a = t[o], !(a.x && a.y && a.planarGraphId) || isNaN(a.x) || isNaN(a.y) || isNaN(a.planarGraphId))throw new Error("Invalid Transit Points");
            return n = new i.DataSource({
              appKey: this.options.appKey || this.options.AppKey,
              server: this.options.server
            }), s = {transitPoints: t}, n.requestTransitNavigation(s).then(function (t) {
              return function (e) {
                return t._parseRawRoutines(e.features), t._rawRoutines = e.features
              }
            }(this)).nodeify(e)
          }, getRawRoutines: function () {
            return this._rawRoutines
          }, getNaviLineDistance: function () {
            var t, e;
            return this._rawRoutines ? (e = 0, e -= this.options.floor_height, t = -1, this._rawRoutines.forEach(function (i) {
              if (e += this._distanceTo(i.geometry.coordinates), i.properties.planar_graph !== t)return e += this.options.floor_height, t = i.properties.planar_graph
            }, this), e) : 0
          }, _distanceTo: function (t) {
            return Math.sqrt(Math.pow(t[0][0] - t[1][0], 2) + Math.pow(t[0][1] - t[1][1], 2))
          }, _comparePoints: function (t, e) {
            var i, n, o;
            return !(!t || !e) && (o = .01, i = [t, e], n = this._distanceTo(i), n <= o)
          }, _getSegmentedRoutinesOnPlanarGraph: function (t) {
            var e, i, n, o, r, s, a, h;
            if (this._rawRoutines) {
              for (n = {type: "FeatureCollection", features: []}, e = function () {
                this.type = "Feature", this.properties = {planar_graph: t}, this.geometry = {
                  type: "LineString",
                  coordinates: []
                }
              }, h = this._rawRoutines, r = o = 0, s = h.length; o < s; r = ++o)a = h[r], a.properties.planar_graph === t && (i = new e, i.geometry.coordinates.push(a.geometry.coordinates), n.features.push(i));
              return n
            }
          }, _createFeatureCollection: function () {
            var t;
            return t = {type: "FeatureCollection", features: []}
          }, _createFeature: function (t) {
            var e;
            return e = {
              type: "Feature",
              geometry: {coordinates: [], type: t},
              properties: {planar_graph: null}
            }
          }, _parseRawRoutines: function (t) {
            var e, i, n, o, r, s, a, h, l, u, c, p, d, f, _, m, g, y, v, L;
            for (this._navigations = {}, this._planarGraphOrder = [], s = null, r = null, h = null, o = null, a = null, y = [], u = 0, d = t.length; u < d; u++) {
              for (_ = t[u], n = _.geometry.coordinates, g = _.properties, m = g.poi, e = g.planar_graph, l = g.hasTransitPoint, e !== s ? (r = this._createFeatureCollection(), h = this._createFeatureCollection(), o = this._createFeature("MultiLineString"), o.properties.poi = [m], o.properties.planar_graph = e, o.geometry.coordinates.push([]), r.features.push(o), a = this._createFeature("MultiPoint"), a.properties.planar_graph = e, h.features.push(a), this._navigations[e] = {
                Navi: r,
                TransitPoints: h
              }, this._planarGraphOrder.push(e), s = e) : o.properties.poi[1] = m, c = 0, f = n.length; c < f; c++)i = n[c], L = o.geometry.coordinates[0], p = L.length, v = L[p - 1], v && this._comparePoints(v, i) || L.push(i);
              l ? (p = n.length, y.push(a.geometry.coordinates.push(n[p - 1]))) : y.push(void 0)
            }
            return y
          }, getPlanarGraphOrder: function () {
            return this._planarGraphOrder
          }, getRoutinesOnPlanarGraph: function (t) {
            return this._navigations[t]
          }, getClosestPoint: function (t, e, n) {
            var o, r, s, a, h, l, u, c, p, d, f, _, m, g, y, v;
            if (u = 1 / 0, y = this._getSegmentedRoutinesOnPlanarGraph(t), p = new i.Point(e, n), p.distance = u, !y)return p;
            for (m = y.features, r = 0, h = m.length; r < h; r++)for (o = m[r], d = void 0, g = o.geometry.coordinates[0], s = a = 0, l = g.length; a < l; s = ++a)_ = g[s], 0 !== s ? (f = new i.point(_[0], _[1]), v = L.LineUtil._sqClosestPointOnSegment(p, d, f, !0), v < u && (u = v, c = L.LineUtil._sqClosestPointOnSegment(p, d, f)), d = f) : d = new i.point(_[0], _[1]);
            return c && (c.distance = Math.sqrt(u)), c
          }
        }), e.exports.navigationProvider = function (t) {
          return new i.NavigationProvider(t)
        }
      }).call(this)
    }, {"../../third_party/leaflet/dist/ngr-src.js": 22}], 13: [function (t, e, i) {
      (function () {
        var i;
        i = t("../third_party/leaflet/dist/ngr-src.js"), i._coreMap = t("./CoreMap.js"), i.View = function (t, e) {
          var n;
          (e.appKey || e.AppKey) && (this._key = e.appKey || e.AppKey, n = "[object String]" === Object.prototype.toString.call(t) ? document.getElementById(t) : t, n && (this._core_map = new i._coreMap(n, e)))

        }, i.View.prototype.on = function (t, e, i) {
          return this._core_map.on(t, e, i)
        }, i.View.prototype.once = function (t, e, i) {
          return this._core_map.once(t, e, i)
        }, i.View.prototype.off = function (t, e, i) {
          return this._core_map.off(t, e, i)
        }, i.View.prototype.fire = function (t, e) {
          return this._core_map.fire(t, e)
        }, i.View.prototype.setView = function (t, e) {
          return this._core_map.setView(t, e)
        }, i.View.prototype.setZoom = function (t) {
          return this._core_map.setZoom(t)
        }, i.View.prototype.zoomIn = function (t) {
          return null == t && (t = 1), this._core_map.zoomIn(t)
        }, i.View.prototype.zoomOut = function (t) {
          return null == t && (t = 1), this._core_map.zoomOut(t)
        }, i.View.prototype.setZoomAround = function (t, e, i) {
          return this._core_map.setZoomAround(t, e, i)
        }, i.View.prototype.fitBounds = function (t) {
          return this._core_map.fitBounds(t)
        }, i.View.prototype.panTo = function (t, e) {
          return this._core_map.panTo(t, e)
        }, i.View.prototype.panInsideBounds = function (t, e) {
          return this._core_map.panInsideBounds(t, e)
        }, i.View.prototype.panBy = function (t, e) {
          return this._core_map.panBy(t, e)
        }, i.View.prototype.setMaxBounds = function (t) {
          return this._core_map.setMaxBounds(t)
        }, i.View.prototype.setMinZoom = function (t) {
          return this._core_map.setMinZoom(t)
        }, i.View.prototype.setMaxZoom = function (t) {
          return this._core_map.setMaxZoom(t)
        }, i.View.prototype.remove = function () {
          return this._core_map.remove()
        }, i.View.prototype.getCenter = function () {
          return this._core_map.getCenter()
        }, i.View.prototype.getZoom = function () {
          return this._core_map.getZoom()
        }, i.View.prototype.getMinZoom = function () {
          return this._core_map.getMinZoom()
        }, i.View.prototype.getMaxZoom = function () {
          return this._core_map.getMaxZoom()
        }, i.View.prototype.getBounds = function () {
          return this._core_map.getBounds()
        }, i.View.prototype.getBoundsZoom = function (t, e) {
          return this._core_map.getBoundsZoom(t, e)
        }, i.View.prototype.getSize = function () {
          return this._core_map.getSize()
        }, i.View.prototype.addLayer = function (t) {
          return t instanceof i.FeatureLayer ? this._core_map.addFeatureLayer(t) : this._core_map.addLayer(t)
        }, i.View.prototype.removeLayer = function (t) {
          return t instanceof i.FeatureLayer ? this._core_map.removeFeatureLayer(t) : this._core_map.removeLayer(t)
        }, i.View.prototype.hasLayer = function (t) {
          return this._core_map.hasLayer(t)
        }, i.View.prototype.eachLayer = function (t, e) {
          return this._core_map.eachLayer(t, e)
        }, i.View.prototype.openPopup = function (t, e, i) {
          return this._core_map.openPopup(t, e, i)
        }, i.View.prototype.closePopup = function (t) {
          return this._core_map.closePopup(t)
        }, i.View.prototype.addControl = function (t) {
          return this._core_map.addControl(t)
        }, i.View.prototype.removeControl = function (t) {
          return this._core_map.removeControl(t)
        }, i.View.prototype.latLngToContainerPoint = function (t) {
          return this._core_map.latLngToContainerPoint(t)
        }, i.View.prototype.containerPointToLatLng = function (t) {
          return this._core_map.containerPointToLatLng(t)
        }, i.View.prototype.mouseEventToContainerPoint = function (t) {
          return this._core_map.mouseEventToContainerPoint(t)
        }, i.View.prototype.mouseEventToLatLng = function (t) {
          return this._core_map.mouseEventToLatLng(t)
        }, i.View.prototype.getContainer = function () {
          return this._core_map.getContainer()
        }, i.View.prototype.addFeatureLayer = function (t) {
          return this._core_map.addFeatureLayer(t), this
        }, i.View.prototype.removeFeatureLayer = function (t) {
          return this._core_map.removeFeatureLayer(t), this
        }, i.View.prototype.render = function () {
          return this._core_map.render(), this
        }, i.View.prototype.clear = function () {
          return this._core_map.clear(), this
        }, i.View.CRS = i.CRS.EPSG3857, i.view = function (t, e) {
          return new i.View(t, e)
        }, e.exports = {View: i.View, view: i.view}
      }).call(this)
    }, {"../third_party/leaflet/dist/ngr-src.js": 22, "./CoreMap.js": 3}], 14: [function (t, e, i) {
      (function () {
        var i, n, o, r, s, a, h, l, u;
        r = t("../third_party/leaflet/dist/ngr-src.js"), r.version = "1.0.1", r._coreMap = t("./CoreMap.js"), r.Cache = t("./Cache.js"), h = t("./DataSource_new.js"), r.DataSource = h.DataSource, r.dataSource = h.dataSource, r.DataUtils = t("./DataUtils.js"), l = t("./FeatureLayer.js"), r.FeatureLayer = l.FeatureLayer, r.featureLayer = l.featureLayer, r.IO = t("./IO.js"), r.FeatureLayerUtils = t("./FeatureLayerUtils.js"), a = t("./View.js"), r.View = a.View, r.view = a.view, o = t("./Service/LocationProvider.js"), r.LocationProvider = o.LocationProvider, r.locationProvider = o.locationProvider, s = t("./Service/NavigationProvider.js"), r.NavigationProvider = s.NavigationProvider, r.navigationProvider = s.navigationProvider, n = t("./Controls/Control.Floor.js"), r.Control.Floor = n.Floor, r.Control.floor = n.floor, i = t("./Service/BleLocation.js"), r.BeaconLocationEngine = i.BeaconLocationEngine, u = t("./QuickRenderer.js"), r.QuickRender = u.quickRender, e.exports = r
      }).call(this)
    }, {
      "../third_party/leaflet/dist/ngr-src.js": 22,
      "./Cache.js": 1,
      "./Controls/Control.Floor.js": 2,
      "./CoreMap.js": 3,
      "./DataSource_new.js": 4,
      "./DataUtils.js": 5,
      "./FeatureLayer.js": 6,
      "./FeatureLayerUtils.js": 7,
      "./IO.js": 8,
      "./QuickRenderer.js": 9,
      "./Service/BleLocation.js": 10,
      "./Service/LocationProvider.js": 11,
      "./Service/NavigationProvider.js": 12,
      "./View.js": 13
    }], 15: [function (t, e, i) {
      function n(t) {
        this._comparator = t || n.DEFAULT_COMPARATOR, this._elements = []
      }

      e.exports = n, n.DEFAULT_COMPARATOR = function (t, e) {
        return "number" == typeof t && "number" == typeof e ? t - e : (t = t.toString(), e = e.toString(), t == e ? 0 : t > e ? 1 : -1)
      }, n.prototype.isEmpty = function () {
        return 0 === this.size()
      }, n.prototype.peek = function () {
        if (this.isEmpty())throw new Error("PriorityQueue is empty");
        return this._elements[0]
      }, n.prototype.deq = function () {
        var t = this.peek(), e = this._elements.pop(), i = this.size();
        if (0 === i)return t;
        this._elements[0] = e;
        for (var n = 0; n < i;) {
          var o = n, r = 2 * n + 1, s = 2 * n + 2;
          if (r < i && this._compare(r, o) >= 0 && (o = r), s < i && this._compare(s, o) >= 0 && (o = s), o === n)break;
          this._swap(o, n), n = o
        }
        return t
      }, n.prototype.enq = function (t) {
        for (var e = this._elements.push(t), i = e - 1; i > 0;) {
          var n = Math.floor((i - 1) / 2);
          if (this._compare(i, n) <= 0)break;
          this._swap(n, i), i = n
        }
        return e
      }, n.prototype.size = function () {
        return this._elements.length
      }, n.prototype.forEach = function (t) {
        return this._elements.forEach(t)
      }, n.prototype._compare = function (t, e) {
        return this._comparator(this._elements[t], this._elements[e])
      }, n.prototype._swap = function (t, e) {
        var i = this._elements[t];
        this._elements[t] = this._elements[e], this._elements[e] = i
      }
    }, {}], 16: [function (t, e, i) {
      function n() {
      }

      var o = e.exports = {};
      o.nextTick = function () {
        var t = "undefined" != typeof window && window.setImmediate,
          e = "undefined" != typeof window && window.postMessage && window.addEventListener;
        if (t)return function (t) {
          return window.setImmediate(t)
        };
        if (e) {
          var i = [];
          return window.addEventListener("message", function (t) {
            var e = t.source;
            if ((e === window || null === e) && "process-tick" === t.data && (t.stopPropagation(), i.length > 0)) {
              var n = i.shift();
              n()
            }
          }, !0), function (t) {
            i.push(t), window.postMessage("process-tick", "*")
          }
        }
        return function (t) {
          setTimeout(t, 0)
        }
      }(), o.title = "browser", o.browser = !0, o.env = {}, o.argv = [], o.on = n, o.addListener = n, o.once = n, o.off = n, o.removeListener = n, o.removeAllListeners = n, o.emit = n, o.binding = function (t) {
        throw new Error("process.binding is not supported")
      }, o.cwd = function () {
        return "/"
      }, o.chdir = function (t) {
        throw new Error("process.chdir is not supported")
      }
    }, {}], 17: [function (t, e, i) {
      (function (t) {
        !function (t) {
          "use strict";
          if ("function" == typeof bootstrap) bootstrap("promise", t); else if ("object" == typeof i && "object" == typeof e) e.exports = t(); else if ("function" == typeof define && define.amd) define(t); else if ("undefined" != typeof ses) {
            if (!ses.ok())return;
            ses.makeQ = t
          } else {
            if ("undefined" == typeof window && "undefined" == typeof self)throw new Error("This environment was not anticipated by Q. Please file a bug.");
            var n = "undefined" != typeof window ? window : self, o = n.Q;
            n.Q = t(), n.Q.noConflict = function () {
              return n.Q = o, this
            }
          }
        }(function () {
          "use strict";
          function e(t) {
            return function () {
              return q.apply(t, arguments)
            }
          }

          function i(t) {
            return t === Object(t)
          }

          function n(t) {
            return "[object StopIteration]" === nt(t) || t instanceof J
          }

          function o(t, e) {
            if (Q && e.stack && "object" == typeof t && null !== t && t.stack && t.stack.indexOf(ot) === -1) {
              for (var i = [], n = e; n; n = n.source)n.stack && i.unshift(n.stack);
              i.unshift(t.stack);
              var o = i.join("\n" + ot + "\n");
              t.stack = r(o)
            }
          }

          function r(t) {
            for (var e = t.split("\n"), i = [], n = 0; n < e.length; ++n) {
              var o = e[n];
              h(o) || s(o) || !o || i.push(o)
            }
            return i.join("\n")
          }

          function s(t) {
            return t.indexOf("(module.js:") !== -1 || t.indexOf("(node.js:") !== -1
          }

          function a(t) {
            var e = /at .+ \((.+):(\d+):(?:\d+)\)$/.exec(t);
            if (e)return [e[1], Number(e[2])];
            var i = /at ([^ ]+):(\d+):(?:\d+)$/.exec(t);
            if (i)return [i[1], Number(i[2])];
            var n = /.*@(.+):(\d+)$/.exec(t);
            return n ? [n[1], Number(n[2])] : void 0
          }

          function h(t) {
            var e = a(t);
            if (!e)return !1;
            var i = e[0], n = e[1];
            return i === Z && n >= Y && n <= lt
          }

          function l() {
            if (Q)try {
              throw new Error
            } catch (t) {
              var e = t.stack.split("\n"), i = e[0].indexOf("@") > 0 ? e[1] : e[2], n = a(i);
              if (!n)return;
              return Z = n[0], n[1]
            }
          }

          function u(t, e, i) {
            return function () {
              return "undefined" != typeof console && "function" == typeof console.warn && console.warn(e + " is deprecated, use " + i + " instead.", new Error("").stack), t.apply(t, arguments)
            }
          }

          function c(t) {
            return t instanceof _ ? t : v(t) ? P(t) : b(t)
          }

          function p() {
            function t(t) {
              e = t, r.source = t, K(i, function (e, i) {
                c.nextTick(function () {
                  t.promiseDispatch.apply(t, i)
                })
              }, void 0), i = void 0, n = void 0
            }

            var e, i = [], n = [], o = tt(p.prototype), r = tt(_.prototype);
            if (r.promiseDispatch = function (t, o, r) {
                var s = H(arguments);
                i ? (i.push(s), "when" === o && r[1] && n.push(r[1])) : c.nextTick(function () {
                  e.promiseDispatch.apply(e, s)
                })
              }, r.valueOf = function () {
                if (i)return r;
                var t = g(e);
                return y(t) && (e = t), t
              }, r.inspect = function () {
                return e ? e.inspect() : {state: "pending"}
              }, c.longStackSupport && Q)try {
              throw new Error
            } catch (s) {
              r.stack = s.stack.substring(s.stack.indexOf("\n") + 1)
            }
            return o.promise = r, o.resolve = function (i) {
              e || t(c(i))
            }, o.fulfill = function (i) {
              e || t(b(i))
            }, o.reject = function (i) {
              e || t(T(i))
            }, o.notify = function (t) {
              e || K(n, function (e, i) {
                c.nextTick(function () {
                  i(t)
                })
              }, void 0)
            }, o
          }

          function d(t) {
            if ("function" != typeof t)throw new TypeError("resolver must be a function.");
            var e = p();
            try {
              t(e.resolve, e.reject, e.notify)
            } catch (i) {
              e.reject(i)
            }
            return e.promise
          }

          function f(t) {
            return d(function (e, i) {
              for (var n = 0, o = t.length; n < o; n++)c(t[n]).then(e, i)
            })
          }

          function _(t, e, i) {
            void 0 === e && (e = function (t) {
              return T(new Error("Promise does not support operation: " + t))
            }), void 0 === i && (i = function () {
              return {state: "unknown"}
            });
            var n = tt(_.prototype);
            if (n.promiseDispatch = function (i, o, r) {
                var s;
                try {
                  s = t[o] ? t[o].apply(n, r) : e.call(n, o, r)
                } catch (a) {
                  s = T(a)
                }
                i && i(s)
              }, n.inspect = i, i) {
              var o = i();
              "rejected" === o.state && (n.exception = o.reason), n.valueOf = function () {
                var t = i();
                return "pending" === t.state || "rejected" === t.state ? n : t.value
              }
            }
            return n
          }

          function m(t, e, i, n) {
            return c(t).then(e, i, n)
          }

          function g(t) {
            if (y(t)) {
              var e = t.inspect();
              if ("fulfilled" === e.state)return e.value
            }
            return t
          }

          function y(t) {
            return t instanceof _
          }

          function v(t) {
            return i(t) && "function" == typeof t.then
          }

          function L(t) {
            return y(t) && "pending" === t.inspect().state
          }

          function M(t) {
            return !y(t) || "fulfilled" === t.inspect().state
          }

          function w(t) {
            return y(t) && "rejected" === t.inspect().state
          }

          function C() {
            rt.length = 0, st.length = 0, ht || (ht = !0)
          }

          function x(e, i) {
            ht && ("object" == typeof t && "function" == typeof t.emit && c.nextTick.runAfter(function () {
              X(st, e) !== -1 && (t.emit("unhandledRejection", i, e), at.push(e))
            }), st.push(e), i && "undefined" != typeof i.stack ? rt.push(i.stack) : rt.push("(no stack) " + i))
          }

          function D(e) {
            if (ht) {
              var i = X(st, e);
              i !== -1 && ("object" == typeof t && "function" == typeof t.emit && c.nextTick.runAfter(function () {
                var n = X(at, e);
                n !== -1 && (t.emit("rejectionHandled", rt[i], e), at.splice(n, 1))
              }), st.splice(i, 1), rt.splice(i, 1))
            }
          }

          function T(t) {
            var e = _({
              when: function (e) {
                return e && D(this), e ? e(t) : this
              }
            }, function () {
              return this
            }, function () {
              return {state: "rejected", reason: t}
            });
            return x(e, t), e
          }

          function b(t) {
            return _({
              when: function () {
                return t
              }, get: function (e) {
                return t[e]
              }, set: function (e, i) {
                t[e] = i
              }, "delete": function (e) {
                delete t[e]
              }, post: function (e, i) {
                return null === e || void 0 === e ? t.apply(void 0, i) : t[e].apply(t, i)
              }, apply: function (e, i) {
                return t.apply(e, i)
              }, keys: function () {
                return it(t)
              }
            }, void 0, function () {
              return {state: "fulfilled", value: t}
            })
          }

          function P(t) {
            var e = p();
            return c.nextTick(function () {
              try {
                t.then(e.resolve, e.reject, e.notify)
              } catch (i) {
                e.reject(i)
              }
            }), e.promise
          }

          function S(t) {
            return _({
              isDef: function () {
              }
            }, function (e, i) {
              return I(t, e, i)
            }, function () {
              return c(t).inspect()
            })
          }

          function j(t, e, i) {
            return c(t).spread(e, i)
          }

          function N(t) {
            return function () {
              function e(t, e) {
                var s;
                if ("undefined" == typeof StopIteration) {
                  try {
                    s = i[t](e)
                  } catch (a) {
                    return T(a)
                  }
                  return s.done ? c(s.value) : m(s.value, o, r)
                }
                try {
                  s = i[t](e)
                } catch (a) {
                  return n(a) ? c(a.value) : T(a)
                }
                return m(s, o, r)
              }

              var i = t.apply(this, arguments), o = e.bind(e, "next"), r = e.bind(e, "throw");
              return o()
            }
          }

          function E(t) {
            c.done(c.async(t)())
          }

          function O(t) {
            throw new J(t)
          }

          function z(t) {
            return function () {
              return j([this, A(arguments)], function (e, i) {
                return t.apply(e, i)
              })
            }
          }

          function I(t, e, i) {
            return c(t).dispatch(e, i)
          }

          function A(t) {
            return m(t, function (t) {
              var e = 0, i = p();
              return K(t, function (n, o, r) {
                var s;
                y(o) && "fulfilled" === (s = o.inspect()).state ? t[r] = s.value : (++e, m(o, function (n) {
                  t[r] = n, 0 === --e && i.resolve(t)
                }, i.reject, function (t) {
                  i.notify({index: r, value: t})
                }))
              }, void 0), 0 === e && i.resolve(t), i.promise
            })
          }

          function k(t) {
            if (0 === t.length)return c.resolve();
            var e = c.defer(), i = 0;
            return K(t, function (n, o, r) {
              function s(t) {
                e.resolve(t)
              }

              function a() {
                i--, 0 === i && e.reject(new Error("Can't get fulfillment value from any promise, all promises were rejected."))
              }

              function h(t) {
                e.notify({index: r, value: t})
              }

              var l = t[r];
              i++, m(l, s, a, h)
            }, void 0), e.promise
          }

          function B(t) {
            return m(t, function (t) {
              return t = $(t, c), m(A($(t, function (t) {
                return m(t, W, W)
              })), function () {
                return t
              })
            })
          }

          function U(t) {
            return c(t).allSettled()
          }

          function R(t, e) {
            return c(t).then(void 0, void 0, e)
          }

          function G(t, e) {
            return c(t).nodeify(e)
          }

          var Q = !1;
          try {
            throw new Error
          } catch (F) {
            Q = !!F.stack
          }
          var Z, J, Y = l(), W = function () {
          }, V = function () {
            function e() {
              for (var t,
                     e; n.next;)n = n.next, t = n.task, n.task = void 0, e = n.domain, e && (n.domain = void 0, e.enter()), i(t, e);
              for (; h.length;)t = h.pop(), i(t);
              r = !1
            }

            function i(t, i) {
              try {
                t()
              } catch (n) {
                if (a)throw i && i.exit(), setTimeout(e, 0), i && i.enter(), n;
                setTimeout(function () {
                  throw n
                }, 0)
              }
              i && i.exit()
            }

            var n = {task: void 0, next: null}, o = n, r = !1, s = void 0, a = !1, h = [];
            if (V = function (e) {
                o = o.next = {task: e, domain: a && t.domain, next: null}, r || (r = !0, s())
              }, "object" == typeof t && "[object process]" === t.toString() && t.nextTick) a = !0, s = function () {
              t.nextTick(e)
            }; else if ("function" == typeof setImmediate) s = "undefined" != typeof window ? setImmediate.bind(window, e) : function () {
              setImmediate(e)
            }; else if ("undefined" != typeof MessageChannel) {
              var l = new MessageChannel;
              l.port1.onmessage = function () {
                s = u, l.port1.onmessage = e, e()
              };
              var u = function () {
                l.port2.postMessage(0)
              };
              s = function () {
                setTimeout(e, 0), u()
              }
            } else s = function () {
              setTimeout(e, 0)
            };
            return V.runAfter = function (t) {
              h.push(t), r || (r = !0, s())
            }, V
          }(), q = Function.call, H = e(Array.prototype.slice), K = e(Array.prototype.reduce || function (t, e) {
              var i = 0, n = this.length;
              if (1 === arguments.length)for (; ;) {
                if (i in this) {
                  e = this[i++];
                  break
                }
                if (++i >= n)throw new TypeError
              }
              for (; i < n; i++)i in this && (e = t(e, this[i], i));
              return e
            }), X = e(Array.prototype.indexOf || function (t) {
              for (var e = 0; e < this.length; e++)if (this[e] === t)return e;
              return -1
            }), $ = e(Array.prototype.map || function (t, e) {
              var i = this, n = [];
              return K(i, function (o, r, s) {
                n.push(t.call(e, r, s, i))
              }, void 0), n
            }), tt = Object.create || function (t) {
              function e() {
              }

              return e.prototype = t, new e
            }, et = e(Object.prototype.hasOwnProperty), it = Object.keys || function (t) {
              var e = [];
              for (var i in t)et(t, i) && e.push(i);
              return e
            }, nt = e(Object.prototype.toString);
          J = "undefined" != typeof ReturnValue ? ReturnValue : function (t) {
            this.value = t
          };
          var ot = "From previous event:";
          c.resolve = c, c.nextTick = V, c.longStackSupport = !1, "object" == typeof t && t && t.env && t.env.Q_DEBUG && (c.longStackSupport = !0), c.defer = p, p.prototype.makeNodeResolver = function () {
            var t = this;
            return function (e, i) {
              e ? t.reject(e) : arguments.length > 2 ? t.resolve(H(arguments, 1)) : t.resolve(i)
            }
          }, c.Promise = d, c.promise = d, d.race = f, d.all = A, d.reject = T, d.resolve = c, c.passByCopy = function (t) {
            return t
          }, _.prototype.passByCopy = function () {
            return this
          }, c.join = function (t, e) {
            return c(t).join(e)
          }, _.prototype.join = function (t) {
            return c([this, t]).spread(function (t, e) {
              if (t === e)return t;
              throw new Error("Can't join: not the same: " + t + " " + e)
            })
          }, c.race = f, _.prototype.race = function () {
            return this.then(c.race)
          }, c.makePromise = _, _.prototype.toString = function () {
            return "[object Promise]"
          }, _.prototype.then = function (t, e, i) {
            function n(e) {
              try {
                return "function" == typeof t ? t(e) : e
              } catch (i) {
                return T(i)
              }
            }

            function r(t) {
              if ("function" == typeof e) {
                o(t, a);
                try {
                  return e(t)
                } catch (i) {
                  return T(i)
                }
              }
              return T(t)
            }

            function s(t) {
              return "function" == typeof i ? i(t) : t
            }

            var a = this, h = p(), l = !1;
            return c.nextTick(function () {
              a.promiseDispatch(function (t) {
                l || (l = !0, h.resolve(n(t)))
              }, "when", [function (t) {
                l || (l = !0, h.resolve(r(t)))
              }])
            }), a.promiseDispatch(void 0, "when", [void 0, function (t) {
              var e, i = !1;
              try {
                e = s(t)
              } catch (n) {
                if (i = !0, !c.onerror)throw n;
                c.onerror(n)
              }
              i || h.notify(e)
            }]), h.promise
          }, c.tap = function (t, e) {
            return c(t).tap(e)
          }, _.prototype.tap = function (t) {
            return t = c(t), this.then(function (e) {
              return t.fcall(e).thenResolve(e)
            })
          }, c.when = m, _.prototype.thenResolve = function (t) {
            return this.then(function () {
              return t
            })
          }, c.thenResolve = function (t, e) {
            return c(t).thenResolve(e)
          }, _.prototype.thenReject = function (t) {
            return this.then(function () {
              throw t
            })
          }, c.thenReject = function (t, e) {
            return c(t).thenReject(e)
          }, c.nearer = g, c.isPromise = y, c.isPromiseAlike = v, c.isPending = L, _.prototype.isPending = function () {
            return "pending" === this.inspect().state
          }, c.isFulfilled = M, _.prototype.isFulfilled = function () {
            return "fulfilled" === this.inspect().state
          }, c.isRejected = w, _.prototype.isRejected = function () {
            return "rejected" === this.inspect().state
          };
          var rt = [], st = [], at = [], ht = !0;
          c.resetUnhandledRejections = C, c.getUnhandledReasons = function () {
            return rt.slice()
          }, c.stopUnhandledRejectionTracking = function () {
            C(), ht = !1
          }, C(), c.reject = T, c.fulfill = b, c.master = S, c.spread = j, _.prototype.spread = function (t, e) {
            return this.all().then(function (e) {
              return t.apply(void 0, e)
            }, e)
          }, c.async = N, c.spawn = E, c["return"] = O, c.promised = z, c.dispatch = I, _.prototype.dispatch = function (t, e) {
            var i = this, n = p();
            return c.nextTick(function () {
              i.promiseDispatch(n.resolve, t, e)
            }), n.promise
          }, c.get = function (t, e) {
            return c(t).dispatch("get", [e])
          }, _.prototype.get = function (t) {
            return this.dispatch("get", [t])
          }, c.set = function (t, e, i) {
            return c(t).dispatch("set", [e, i])
          }, _.prototype.set = function (t, e) {
            return this.dispatch("set", [t, e])
          }, c.del = c["delete"] = function (t, e) {
            return c(t).dispatch("delete", [e])
          }, _.prototype.del = _.prototype["delete"] = function (t) {
            return this.dispatch("delete", [t])
          }, c.mapply = c.post = function (t, e, i) {
            return c(t).dispatch("post", [e, i])
          }, _.prototype.mapply = _.prototype.post = function (t, e) {
            return this.dispatch("post", [t, e])
          }, c.send = c.mcall = c.invoke = function (t, e) {
            return c(t).dispatch("post", [e, H(arguments, 2)])
          }, _.prototype.send = _.prototype.mcall = _.prototype.invoke = function (t) {
            return this.dispatch("post", [t, H(arguments, 1)])
          }, c.fapply = function (t, e) {
            return c(t).dispatch("apply", [void 0, e])
          }, _.prototype.fapply = function (t) {
            return this.dispatch("apply", [void 0, t])
          }, c["try"] = c.fcall = function (t) {
            return c(t).dispatch("apply", [void 0, H(arguments, 1)])
          }, _.prototype.fcall = function () {
            return this.dispatch("apply", [void 0, H(arguments)])
          }, c.fbind = function (t) {
            var e = c(t), i = H(arguments, 1);
            return function () {
              return e.dispatch("apply", [this, i.concat(H(arguments))])
            }
          }, _.prototype.fbind = function () {
            var t = this, e = H(arguments);
            return function () {
              return t.dispatch("apply", [this, e.concat(H(arguments))])
            }
          }, c.keys = function (t) {
            return c(t).dispatch("keys", [])
          }, _.prototype.keys = function () {
            return this.dispatch("keys", [])
          }, c.all = A, _.prototype.all = function () {
            return A(this)
          }, c.any = k, _.prototype.any = function () {
            return k(this)
          }, c.allResolved = u(B, "allResolved", "allSettled"), _.prototype.allResolved = function () {
            return B(this)
          }, c.allSettled = U, _.prototype.allSettled = function () {
            return this.then(function (t) {
              return A($(t, function (t) {
                function e() {
                  return t.inspect()
                }

                return t = c(t), t.then(e, e)
              }))
            })
          }, c.fail = c["catch"] = function (t, e) {
            return c(t).then(void 0, e)
          }, _.prototype.fail = _.prototype["catch"] = function (t) {
            return this.then(void 0, t)
          }, c.progress = R, _.prototype.progress = function (t) {
            return this.then(void 0, void 0, t)
          }, c.fin = c["finally"] = function (t, e) {
            return c(t)["finally"](e)
          }, _.prototype.fin = _.prototype["finally"] = function (t) {
            return t = c(t), this.then(function (e) {
              return t.fcall().then(function () {
                return e
              })
            }, function (e) {
              return t.fcall().then(function () {
                throw e
              })
            })
          }, c.done = function (t, e, i, n) {
            return c(t).done(e, i, n)
          }, _.prototype.done = function (e, i, n) {
            var r = function (t) {
              c.nextTick(function () {
                if (o(t, s), !c.onerror)throw t;
                c.onerror(t)
              })
            }, s = e || i || n ? this.then(e, i, n) : this;
            "object" == typeof t && t && t.domain && (r = t.domain.bind(r)), s.then(void 0, r)
          }, c.timeout = function (t, e, i) {
            return c(t).timeout(e, i)
          }, _.prototype.timeout = function (t, e) {
            var i = p(), n = setTimeout(function () {
              e && "string" != typeof e || (e = new Error(e || "Timed out after " + t + " ms"), e.code = "ETIMEDOUT"), i.reject(e)
            }, t);
            return this.then(function (t) {
              clearTimeout(n), i.resolve(t)
            }, function (t) {
              clearTimeout(n), i.reject(t)
            }, i.notify), i.promise
          }, c.delay = function (t, e) {
            return void 0 === e && (e = t, t = void 0), c(t).delay(e)
          }, _.prototype.delay = function (t) {
            return this.then(function (e) {
              var i = p();
              return setTimeout(function () {
                i.resolve(e)
              }, t), i.promise
            })
          }, c.nfapply = function (t, e) {
            return c(t).nfapply(e)
          }, _.prototype.nfapply = function (t) {
            var e = p(), i = H(t);
            return i.push(e.makeNodeResolver()), this.fapply(i).fail(e.reject), e.promise
          }, c.nfcall = function (t) {
            var e = H(arguments, 1);
            return c(t).nfapply(e)
          }, _.prototype.nfcall = function () {
            var t = H(arguments), e = p();
            return t.push(e.makeNodeResolver()), this.fapply(t).fail(e.reject), e.promise
          }, c.nfbind = c.denodeify = function (t) {
            var e = H(arguments, 1);
            return function () {
              var i = e.concat(H(arguments)), n = p();
              return i.push(n.makeNodeResolver()), c(t).fapply(i).fail(n.reject), n.promise
            }
          }, _.prototype.nfbind = _.prototype.denodeify = function () {
            var t = H(arguments);
            return t.unshift(this), c.denodeify.apply(void 0, t)
          }, c.nbind = function (t, e) {
            var i = H(arguments, 2);
            return function () {
              function n() {
                return t.apply(e, arguments)
              }

              var o = i.concat(H(arguments)), r = p();
              return o.push(r.makeNodeResolver()), c(n).fapply(o).fail(r.reject), r.promise
            }
          }, _.prototype.nbind = function () {
            var t = H(arguments, 0);
            return t.unshift(this), c.nbind.apply(void 0, t)
          }, c.nmapply = c.npost = function (t, e, i) {
            return c(t).npost(e, i)
          }, _.prototype.nmapply = _.prototype.npost = function (t, e) {
            var i = H(e || []), n = p();
            return i.push(n.makeNodeResolver()), this.dispatch("post", [t, i]).fail(n.reject), n.promise
          }, c.nsend = c.nmcall = c.ninvoke = function (t, e) {
            var i = H(arguments, 2), n = p();
            return i.push(n.makeNodeResolver()), c(t).dispatch("post", [e, i]).fail(n.reject), n.promise
          }, _.prototype.nsend = _.prototype.nmcall = _.prototype.ninvoke = function (t) {
            var e = H(arguments, 1), i = p();
            return e.push(i.makeNodeResolver()), this.dispatch("post", [t, e]).fail(i.reject), i.promise
          }, c.nodeify = G, _.prototype.nodeify = function (t) {
            return t ? void this.then(function (e) {
              c.nextTick(function () {
                t(null, e)
              })
            }, function (e) {
              c.nextTick(function () {
                t(e)
              })
            }) : this
          }, c.noConflict = function () {
            throw new Error("Q.noConflict only works when Q is used as a global")
          };
          var lt = l();
          return c
        })
      }).call(this, t("qC859L"))
    }, {qC859L: 16}], 18: [function (t, e, i) {
      !function () {
        "use strict";
        function t(e, i) {
          return this instanceof t ? (this._maxEntries = Math.max(4, e || 9), this._minEntries = Math.max(2, Math.ceil(.4 * this._maxEntries)), i && this._initFormat(i), void this.clear()) : new t(e, i)
        }

        function i(t, e) {
          t.bbox = n(t, 0, t.children.length, e)
        }

        function n(t, e, i, n) {
          for (var s, a = o(), h = e; h < i; h++)s = t.children[h], r(a, t.leaf ? n(s) : s.bbox);
          return a
        }

        function o() {
          return [1 / 0, 1 / 0, -(1 / 0), -(1 / 0)]
        }

        function r(t, e) {
          return t[0] = Math.min(t[0], e[0]), t[1] = Math.min(t[1], e[1]), t[2] = Math.max(t[2], e[2]), t[3] = Math.max(t[3], e[3]), t
        }

        function s(t, e) {
          return t.bbox[0] - e.bbox[0]
        }

        function a(t, e) {
          return t.bbox[1] - e.bbox[1]
        }

        function h(t) {
          return (t[2] - t[0]) * (t[3] - t[1])
        }

        function l(t) {
          return t[2] - t[0] + (t[3] - t[1])
        }

        function u(t, e) {
          return (Math.max(e[2], t[2]) - Math.min(e[0], t[0])) * (Math.max(e[3], t[3]) - Math.min(e[1], t[1]))
        }

        function c(t, e) {
          var i = Math.max(t[0], e[0]), n = Math.max(t[1], e[1]), o = Math.min(t[2], e[2]), r = Math.min(t[3], e[3]);
          return Math.max(0, o - i) * Math.max(0, r - n)
        }

        function p(t, e) {
          return t[0] <= e[0] && t[1] <= e[1] && e[2] <= t[2] && e[3] <= t[3]
        }

        function d(t, e) {
          return e[0] <= t[2] && e[1] <= t[3] && e[2] >= t[0] && e[3] >= t[1]
        }

        function f(t, e, i, n, o) {
          for (var r,
                 s = [e, i]; s.length;)i = s.pop(), e = s.pop(), i - e <= n || (r = e + Math.ceil((i - e) / n / 2) * n, _(t, e, i, r, o), s.push(e, r, r, i))
        }

        function _(t, e, i, n, o) {
          for (var r, s, a, h, l, u, c, p, d; i > e;) {
            for (i - e > 600 && (r = i - e + 1, s = n - e + 1, a = Math.log(r), h = .5 * Math.exp(2 * a / 3), l = .5 * Math.sqrt(a * h * (r - h) / r) * (s - r / 2 < 0 ? -1 : 1), u = Math.max(e, Math.floor(n - s * h / r + l)), c = Math.min(i, Math.floor(n + (r - s) * h / r + l)), _(t, u, c, n, o)), p = t[n], s = e, d = i, m(t, e, n), o(t[i], p) > 0 && m(t, e, i); s < d;) {
              for (m(t, s, d), s++, d--; o(t[s], p) < 0;)s++;
              for (; o(t[d], p) > 0;)d--
            }
            0 === o(t[e], p) ? m(t, e, d) : (d++, m(t, d, i)), d <= n && (e = d + 1), n <= d && (i = d - 1)
          }
        }

        function m(t, e, i) {
          var n = t[e];
          t[e] = t[i], t[i] = n
        }

        t.prototype = {
          all: function () {
            return this._all(this.data, [])
          }, search: function (t) {
            var e = this.data, i = [], n = this.toBBox;
            if (!d(t, e.bbox))return i;
            for (var o, r, s, a, h = []; e;) {
              for (o = 0, r = e.children.length; o < r; o++)s = e.children[o], a = e.leaf ? n(s) : s.bbox, d(t, a) && (e.leaf ? i.push(s) : p(t, a) ? this._all(s, i) : h.push(s));
              e = h.pop()
            }
            return i
          }, collides: function (t) {
            var e = this.data, i = this.toBBox;
            if (!d(t, e.bbox))return !1;
            for (var n, o, r, s, a = []; e;) {
              for (n = 0, o = e.children.length; n < o; n++)if (r = e.children[n], s = e.leaf ? i(r) : r.bbox, d(t, s)) {
                if (e.leaf || p(t, s))return !0;
                a.push(r)
              }
              e = a.pop()
            }
            return !1
          }, load: function (t) {
            if (!t || !t.length)return this;
            if (t.length < this._minEntries) {
              for (var e = 0, i = t.length; e < i; e++)this.insert(t[e]);
              return this
            }
            var n = this._build(t.slice(), 0, t.length - 1, 0);
            if (this.data.children.length)if (this.data.height === n.height) this._splitRoot(this.data, n); else {
              if (this.data.height < n.height) {
                var o = this.data;
                this.data = n, n = o
              }
              this._insert(n, this.data.height - n.height - 1, !0)
            } else this.data = n;
            return this
          }, insert: function (t) {
            return t && this._insert(t, this.data.height - 1), this
          }, clear: function () {
            return this.data = {children: [], height: 1, bbox: o(), leaf: !0}, this
          }, remove: function (t) {
            if (!t)return this;
            for (var e, i, n, o, r = this.data, s = this.toBBox(t), a = [], h = []; r || a.length;) {
              if (r || (r = a.pop(), i = a[a.length - 1], e = h.pop(), o = !0), r.leaf && (n = r.children.indexOf(t), n !== -1))return r.children.splice(n, 1), a.push(r), this._condense(a), this;
              o || r.leaf || !p(r.bbox, s) ? i ? (e++, r = i.children[e], o = !1) : r = null : (a.push(r), h.push(e), e = 0, i = r, r = r.children[0])
            }
            return this
          }, toBBox: function (t) {
            return t
          }, compareMinX: function (t, e) {
            return t[0] - e[0]
          }, compareMinY: function (t, e) {
            return t[1] - e[1]
          }, toJSON: function () {
            return this.data
          }, fromJSON: function (t) {
            return this.data = t, this
          }, _all: function (t, e) {
            for (var i = []; t;)t.leaf ? e.push.apply(e, t.children) : i.push.apply(i, t.children), t = i.pop();
            return e
          }, _build: function (t, e, n, o) {
            var r, s = n - e + 1, a = this._maxEntries;
            if (s <= a)return r = {
              children: t.slice(e, n + 1),
              height: 1,
              bbox: null,
              leaf: !0
            }, i(r, this.toBBox), r;
            o || (o = Math.ceil(Math.log(s) / Math.log(a)), a = Math.ceil(s / Math.pow(a, o - 1))), r = {
              children: [],
              height: o,
              bbox: null,
              leaf: !1
            };
            var h, l, u, c, p = Math.ceil(s / a), d = p * Math.ceil(Math.sqrt(a));
            for (f(t, e, n, d, this.compareMinX), h = e; h <= n; h += d)for (u = Math.min(h + d - 1, n), f(t, h, u, p, this.compareMinY), l = h; l <= u; l += p)c = Math.min(l + p - 1, u), r.children.push(this._build(t, l, c, o - 1));
            return i(r, this.toBBox), r
          }, _chooseSubtree: function (t, e, i, n) {
            for (var o, r, s, a, l, c, p, d; ;) {
              if (n.push(e), e.leaf || n.length - 1 === i)break;
              for (p = d = 1 / 0, o = 0, r = e.children.length; o < r; o++)s = e.children[o], l = h(s.bbox), c = u(t, s.bbox) - l, c < d ? (d = c, p = l < p ? l : p, a = s) : c === d && l < p && (p = l, a = s);
              e = a || e.children[0]
            }
            return e
          }, _insert: function (t, e, i) {
            var n = this.toBBox, o = i ? t.bbox : n(t), s = [], a = this._chooseSubtree(o, this.data, e, s);
            for (a.children.push(t), r(a.bbox, o); e >= 0 && s[e].children.length > this._maxEntries;)this._split(s, e), e--;
            this._adjustParentBBoxes(o, s, e)
          }, _split: function (t, e) {
            var n = t[e], o = n.children.length, r = this._minEntries;
            this._chooseSplitAxis(n, r, o);
            var s = this._chooseSplitIndex(n, r, o), a = {
              children: n.children.splice(s, n.children.length - s),
              height: n.height,
              bbox: null,
              leaf: !1
            };
            n.leaf && (a.leaf = !0), i(n, this.toBBox), i(a, this.toBBox), e ? t[e - 1].children.push(a) : this._splitRoot(n, a)
          }, _splitRoot: function (t, e) {
            this.data = {
              children: [t, e],
              height: t.height + 1,
              bbox: null,
              leaf: !1
            }, i(this.data, this.toBBox)
          }, _chooseSplitIndex: function (t, e, i) {
            var o, r, s, a, l, u, p, d;
            for (u = p = 1 / 0, o = e; o <= i - e; o++)r = n(t, 0, o, this.toBBox), s = n(t, o, i, this.toBBox), a = c(r, s), l = h(r) + h(s), a < u ? (u = a, d = o, p = l < p ? l : p) : a === u && l < p && (p = l, d = o);
            return d
          }, _chooseSplitAxis: function (t, e, i) {
            var n = t.leaf ? this.compareMinX : s, o = t.leaf ? this.compareMinY : a,
              r = this._allDistMargin(t, e, i, n), h = this._allDistMargin(t, e, i, o);
            r < h && t.children.sort(n)
          }, _allDistMargin: function (t, e, i, o) {
            t.children.sort(o);
            var s, a, h = this.toBBox, u = n(t, 0, e, h), c = n(t, i - e, i, h), p = l(u) + l(c);
            for (s = e; s < i - e; s++)a = t.children[s], r(u, t.leaf ? h(a) : a.bbox), p += l(u);
            for (s = i - e - 1; s >= e; s--)a = t.children[s], r(c, t.leaf ? h(a) : a.bbox), p += l(c);
            return p
          }, _adjustParentBBoxes: function (t, e, i) {
            for (var n = i; n >= 0; n--)r(e[n].bbox, t)
          }, _condense: function (t) {
            for (var e,
                   n = t.length - 1; n >= 0; n--)0 === t[n].children.length ? n > 0 ? (e = t[n - 1].children, e.splice(e.indexOf(t[n]), 1)) : this.clear() : i(t[n], this.toBBox)
          }, _initFormat: function (t) {
            var e = ["return a", " - b", ";"];
            this.compareMinX = new Function("a", "b", e.join(t[0])), this.compareMinY = new Function("a", "b", e.join(t[1])), this.toBBox = new Function("a", "return [a" + t.join(", a") + "];")
          }
        }, "function" == typeof define && define.amd ? define("rbush", function () {
          return t
        }) : "undefined" != typeof e ? e.exports = t : "undefined" != typeof self ? self.rbush = t : window.rbush = t
      }()
    }, {}], 19: [function (t, e, i) {
      function n(t) {
        return {
          _originalLayers: [],
          _visibleLayers: [],
          _staticLayers: [],
          _featureLayers: [],
          _priorityQueue: null,
          _rbush: [],
          _cachedRelativeBoxes: [],
          _margin: 0,
          _statusList: ["onlyLogo", "right", "bottom", "left", "top", "hidden"],
          initialize: function (e) {
            t.prototype.initialize.call(this, e), this._margin = e.margin || 0, this._rbush = null, this._originalLayers = [], this._visibleLayers = [], this._visibleLayersStatus = [], this._featureLayers = []
          },
          addLayer: function (e) {
            // 判断新增图层是否是featureLayer
            return e instanceof NGR.FeatureLayer ? (this.addFeatureLayer(e), this) : e instanceof L.CanvasLogoLabel || "options" in e && "icon" in e.options ? (this._originalLayers.push(e), this._map && this._maybeAddLayerToRBush(e), this) : (this._staticLayers.push(e), t.prototype.addLayer.call(this, e), this)
          },
          addFeatureLayer: function (t) {
            if (!(t instanceof NGR.FeatureLayer))return console.warn("Invalid Layer Type"), this;
            this._featureLayers.push(t);
            for (var e in t._featureLayers)this.addLayer(t._featureLayers[e]);
            return this
          },
          removeLayer: function (e) {
            if (e instanceof NGR.FeatureLayer)return this.removeFeatureLayer(e), this;
            this._rbush.remove(this._cachedRelativeBoxes[e._ngr_id]), delete this._cachedRelativeBoxes[e._ngr_id], t.prototype.removeLayer.call(this, e);
            var i;
            if (i = this._originalLayers.indexOf(e), i !== -1 && this._originalLayers.splice(i, 1), i = this._visibleLayers.indexOf(e), i !== -1 && this._visibleLayers.splice(i, 1), i = this._staticLayers.indexOf(e), i !== -1 && this._staticLayers.splice(i, 1), this._featureLayers.length > 0 && e && e.feature && e.feature.id)for (var n in this._featureLayers)this._featureLayers[n].removeFeatureById(e.feature.id);
            return this
          },
          removeFeatureLayer: function (t) {
            var e;
            if (e = this._featureLayers.indexOf(t), e != -1) {
              for (var i in t._featureLayers)this.removeLayer(t._featureLayers[i]);
              this._featureLayers.splice(e, 1)
            }
            return this
          },
          clearLayers: function () {
            this._rbush = o(), this._originalLayers = [], this._visibleLayers = [], this._staticLayers = [], this._cachedRelativeBoxes = [], this._featureLayers = [], t.prototype.clearLayers.call(this)
          },
          onAdd: function (t) {
            this._map = t;
            for (var e in this._staticLayers)t.addLayer(this._staticLayers[e]);
            this._onZoomEnd(), t.on("zoomend", this._onZoomEnd, this)
          },
          onRemove: function (e) {
            for (var i in this._staticLayers)e.removeLayer(this._staticLayers[i]);
            e.off("zoomend", this._onZoomEnd, this), t.prototype.onRemove.call(this, e)
          },
          _getIconLabelBox: function (t) {
            for (var e = [], i = 0; i < this._statusList.length - 1; i++) {
              var n;
              if (n = 0 == i ? t.getLogoBounds() : t.getLabelBounds(this._statusList[i])) {
                var o = [n.min.x - this._margin, n.min.y - this._margin, n.max.x + this._margin, n.max.y + this._margin];
                e.push(o)
              }
            }
            return e
          },
          _maybeAddLayerToRBush: function (e) {
            var i = e instanceof L.CanvasLogoLabel, n = (this._map.getZoom(), this._rbush),
              o = this._cachedRelativeBoxes[e._ngr_id], r = !1;
            if (!o) {
              if (t.prototype.addLayer.call(this, e), i) o = this._getIconLabelBox(e); else {
                var s = this._getIconBox(e._icon);
                o = this._getRelativeBoxes(e._icon.children, s), o.push(s)
              }
              this._cachedRelativeBoxes[e._ngr_id] = o
            }
            t.prototype.addLayer.call(this, e);
            o = i && !r ? this._getIconLabelBox(e) : this._positionBoxes(this._map.latLngToLayerPoint(e.getLatLng()), o);
            this._cachedRelativeBoxes[e._ngr_id] = o;
            var a = !1, h = 0;
            t:for (var l = 0; l < o.length; l++) {
              var u = n.search(o[l]);
              if (a = u.length > 0, a && 0 == l) {
                h = -1;
                for (var c in u)if (6 == u[c].length) {
                  var p = u[c][5], d = this._visibleLayers.indexOf(p);
                  if (d != -1 && e.priority > p.priority) {
                    h = -1;
                    break t
                  }
                }
                for (var c in u)if (6 == u[c].length) {
                  var p = u[c][5], d = this._visibleLayers.indexOf(p);
                  if (d != -1) {
                    var f = this._cachedRelativeBoxes[p._ngr_id];
                    if (0 == u[c][4]) {
                      if (e._commonArea) {
                        h = -1;
                        break
                      }
                      var _ = this._visibleLayersStatus[d];
                      this._rbush.remove(u[c]), _ > 0 && this._rbush.remove(f[_]), this._visibleLayers.splice(d, 1), this._visibleLayersStatus.splice(d, 1), t.prototype.removeLayer.call(this, p), h = 0
                    } else if (1 == u[c][4]) {
                      var _ = this._visibleLayersStatus[d];
                      _ > 0 && this._rbush.remove(f[_]), this._visibleLayersStatus[d] = 0;
                      for (var m = 1; m < f.length; m++)if (m != _) {
                        var g = n.search(f[m]);
                        if (0 == g.length || 1 == g.length && g[0] === f[0]) {
                          f[m][4] = 1, f[m][5] = p, n.insert(f[m]);
                          var y = n.search(o[0]);
                          if (0 == y.length) {
                            this._visibleLayersStatus[d] = m;
                            break
                          }
                          n.remove(f[m])
                        }
                      }
                      p._commonArea && 0 == this._visibleLayersStatus[d] && (this._rbush.remove(f[0]), this._visibleLayers.splice(d, 1), this._visibleLayersStatus.splice(d, 1), t.prototype.removeLayer.call(this, p)), h = 0
                    }
                  }
                }
              }
              if (!a && l > 0) {
                h = l;
                break
              }
            }
            h != -1 && (a = !1), 0 == h && !a && e._commonArea && (a = !0), a ? t.prototype.removeLayer.call(this, e) : (r || i && this._visibleLayersStatus.push(h), this._visibleLayers.push(e), i ? 0 == h ? (o[0].push(0), o[0].push(e), n.insert(o[0])) : (o[0].push(0), o[0].push(e), o[h].push(1), o[h].push(e), n.insert(o[0]), n.insert(o[h])) : n.load(o))
          },
          _defaultIcon: function (t) {
          },
          _getIconBox: function (t) {
            if (s)return [0, 0, t.offsetWidth, t.offsetHeight];
            var e = window.getComputedStyle(t);
            return [parseInt(e.marginLeft), parseInt(e.marginTop), parseInt(e.marginLeft) + parseInt(e.width), parseInt(e.marginTop) + parseInt(e.height)]
          },
          _getRelativeBoxes: function (t, e) {
            for (var i = [], n = 0; n < t.length; n++) {
              var o = t[n], r = [o.offsetLeft, o.offsetTop, o.offsetLeft + o.offsetWidth, o.offsetTop + o.offsetHeight];
              if (r = this._offsetBoxes(r, e), i.push(r), o.children.length) {
                var a = e;
                if (!s) {
                  var h = window.getComputedStyle(o).position;
                  "absolute" !== h && "relative" !== h || (a = r)
                }
                i = i.concat(this._getRelativeBoxes(o.children, a))
              }
            }
            return i
          },
          _offsetBoxes: function (t, e) {
            return [t[0] + e[0], t[1] + e[1], t[2] + e[0], t[3] + e[1]]
          },
          _positionBoxes: function (t, e) {
            for (var i = [], n = 0; n < e.length; n++)i.push(this._positionBox(t, e[n]));
            return i
          },
          _positionBox: function (t, e) {
            return [e[0] + t.x - this._margin, e[1] + t.y - this._margin, e[2] + t.x + this._margin, e[3] + t.y + this._margin]
          },
          _onZoomEnd: function () {
            this._visibleLayers = [], this._visibleLayersStatus = [];
            for (var e = 0; e < this._visibleLayers.length; e++)t.prototype.removeLayer.call(this, this._visibleLayers[e]);
            this._priorityQueue = new r(a);
            for (var e = 0; e < this._originalLayers.length; e++)this._priorityQueue.enq(this._originalLayers[e]);
            this._rbush = o();
            var i = this;
            this._priorityQueue.forEach(function (t) {
              i._maybeAddLayerToRBush(t)
            });
            for (var e = 0; e < this._visibleLayers.length; e++)this._visibleLayers[e]._setStatus(this._statusList[this._visibleLayersStatus[e]])
          }
        }
      }

      var o = t("rbush"), r = t("priorityqueuejs"),
        s = !("getComputedStyle" in window && "function" == typeof window.getComputedStyle), a = function (t, e) {
          return t.priority - e.priority > 0 ? -1 : 1
        };
      L.LayerGroup.Collision = L.LayerGroup.extend(n(L.LayerGroup)), L.FeatureGroup.Collision = L.FeatureGroup.extend(n(L.FeatureGroup)), L.GeoJSON.Collision = L.GeoJSON.extend(n(L.GeoJSON)), L.LayerGroup.collision = function (t) {
        return new L.LayerGroup.Collision(t || {})
      }, L.FeatureGroup.collision = function (t) {
        return new L.FeatureGroup.Collision(t || {})
      }, L.GeoJSON.collision = function (t) {
        return new L.GeoJSON.Collision(t || {})
      }, L.layerGroup.collision = function (t) {
        return new L.LayerGroup.Collision(t || {})
      }, L.featureGroup.collision = function (t) {
        return new L.FeatureGroup.Collision(t || {})
      }, L.geoJson.collision = function (t) {
        return new L.GeoJSON.Collision(t || {})
      }
    }, {priorityqueuejs: 15, rbush: 18}], 20: [function (t, e, i) {
      !function (t, i, n) {
        "undefined" != typeof e && e.exports ? e.exports = n() : "function" == typeof define && define.amd ? define(n) : i[t] = n()
      }("HeatmapOverlay", this, function () {
        var h337;
        h337 = t("../third_party/heatmap.js/build/heatmap.js"), "undefined" == typeof L.Layer && (L.Layer = L.Class);
        var e = L.Layer.extend({
          initialize: function (t) {
            this.cfg = t, this._el = L.DomUtil.create("div", "ngr-zoom-hide"), this._data = [], this._mergeDatas = [], this.minMergeLength = this.cfg.minMergeLength || 1e-7, this._max = 1, this._min = 0, this.cfg.container = this._el, this.initZoom = 24;
          }, onAdd: function (t) {
            // 不是
            var e = t.getSize();
            this._map = t, this.initZoom || (this.initZoom = 27), this._width = e.x, this._height = e.y, this._el.style.width = e.x + "px", this._el.style.height = e.y + "px", this._el.style.position = "absolute", this._resetOrigin();
            var i = t.getPanes(), n = i.overlayPane;
            n.appendChild(this._el), this._heatmap || (this._heatmap = h337.create(this.cfg)), t.on("viewreset", this._resetOrigin, this), t.on("dragend", this._draw, this), this._draw()
          }, onRemove: function (t) {
            t.getPanes().overlayPane.removeChild(this._el), t.off("viewreset", this._resetOrigin, this), t.off("dragend", this._draw, this)
          }, _draw: function () {
            if (this._map) {
              var t = this._map.getPanes().mapPane, i = t._ngr_pos;
              this._el.style[e.CSS_TRANSFORM] = "translate(" + -Math.round(i.x) + "px," + -Math.round(i.y) + "px)", this._update()
            }
          }, _update: function () {
            if (this._heatmap) {
              var t, e, i, n = {max: this._max, min: this._min, data: []};
              if (t = this._map.getBounds(), e = this._map.getZoom() - this.initZoom + (this.cfg.zoomLv ? this.cfg.zoomLv : 6), i = Math.pow(2, e), 0 == this._data.length)return void(this._heatmap && this._heatmap.setData(n));
              for (var o = [], r = this.cfg.scaleRadius ? i : 1, s = 0, a = 0, h = this.cfg.valueField || "value",
                     l = this._data.length; l--;) {
                var u = this._data[l], c = u[h], p = u.latlng;
                if (t.contains(p)) {
                  s = Math.max(c, s), a = Math.min(c, a);
                  var d = this._map.latLngToContainerPoint(p), f = {
                    x: Math.round(d.x),
                    y: Math.round(d.y)
                  };
                  f[h] = c;
                  var _;
                  _ = u.radius ? u.radius * r : (this.cfg.radius || 2) * r, f.radius = _, o.push(f)
                }
              }
              this.cfg.useLocalExtrema && (n.max = s, n.min = a), n.data = o, this._heatmap.setData(n)
            }
          }, _mergePoint: function (t) {
            var e = -1;
            if (t.length > 0)for (var i = t.length; i--;)e = this._mergePoint(t[i]); else {
              var n = this.cfg.latField || "lat", o = this.cfg.lngField || "lng", r = this.cfg.valueField || "value",
                s = this.minMergeLength;
              for (var a in this._mergeDatas) {
                var h = Math.sqrt(Math.pow(t[n] - this._mergeDatas[a][n], 2) + Math.pow(t[o] - this._mergeDatas[a][o], 2));
                h < s && (s = h, e = a)
              }
              if (e == -1) {
                var l = {};
                l[n] = t[n], l[o] = t[o], l[r] = 1, this._mergeDatas.push(l)
              } else {
                this._mergeDatas[e][r]++
              }
            }
            return e
          }, setData: function (t) {
            this._max = t.max || this._max, this._min = t.min || this._min;
            var e = this.cfg.latField || "lat", i = this.cfg.lngField || "lng", n = this.cfg.valueField || "value";
            this._mergePoint(t.data);
            for (var t = this._mergeDatas, o = t.length, r = []; o--;) {
              var s = t[o], a = new L.LatLng(s[e], s[i]), h = {latlng: a};
              h[n] = s[n], s.radius && (h.radius = s.radius), r.push(h)
            }
            this._data = r, this._draw()
          }, addData: function (t) {
            if (t.length > 0)for (var e = t.length; e--;)this.addData(t[e]); else {
              var i = this._mergePoint(t), n = this.cfg.latField || "lat", o = this.cfg.lngField || "lng",
                r = this.cfg.valueField || "value";
              if (i == -1) {
                var s = this._mergeDatas[this._mergeDatas.length - 1], a = new L.LatLng(s[n], s[o]), h = {latlng: a};
                h[r] = s[r], s.radius && (h.radius = s.radius), this._data.push(h)
              } else {
                var l = this._mergeDatas[i][r];
                this._max = Math.max(this._max, l), this._min = Math.min(this._min, l), this._data[i][r] = l
              }
              this._draw()
            }
          }, getBounds: function () {
            for (var t = [], e = 0; e < this._data.length; e++) {
              var i = this._data[e];
              t.push(i.latlng)
            }
            return new L.LatLngBounds(t)
          }, _resetOrigin: function () {
            this._origin = this._map.layerPointToLatLng(new L.Point(0, 0)), this._draw()
          }
        });
        return e.CSS_TRANSFORM = function () {
          for (var t = document.createElement("div"),
                 e = ["transform", "WebkitTransform", "MozTransform", "OTransform", "msTransform"],
                 i = 0; i < e.length; i++) {
            var n = e[i];
            if (void 0 !== t.style[n])return n
          }
          return e[0]
        }(), e
      })
    }, {"../third_party/heatmap.js/build/heatmap.js": 21}], 21: [function (t, e, i) {
      !function (t, i, n) {
        "undefined" != typeof e && e.exports ? e.exports = n() : "function" == typeof define && define.amd ? define(n) : i[t] = n()
      }("h337", this, function () {
        var t = {
          defaultRadius: 40,
          defaultRenderer: "canvas2d",
          defaultGradient: {.25: "rgb(0,0,255)", .55: "rgb(0,255,0)", .85: "yellow", 1: "rgb(255,0,0)"},
          defaultMaxOpacity: 1,
          defaultMinOpacity: 0,
          defaultBlur: .85,
          defaultXField: "x",
          defaultYField: "y",
          defaultValueField: "value",
          plugins: {}
        }, e = function () {
          var e = function (t) {
            this._coordinator = {}, this._data = [], this._radi = [], this._min = 0, this._max = 1, this._xField = t.xField || t.defaultXField, this._yField = t.yField || t.defaultYField, this._valueField = t.valueField || t.defaultValueField, t.radius && (this._cfgRadius = t.radius)
          }, i = t.defaultRadius;
          return e.prototype = {
            _organiseData: function (t, e) {
              var n = t[this._xField], o = t[this._yField], r = this._radi, s = this._data, a = this._max,
                h = this._min, l = t[this._valueField] || 1, u = t.radius || this._cfgRadius || i;
              return s[n] || (s[n] = [], r[n] = []), s[n][o] ? s[n][o] += l : (s[n][o] = l, r[n][o] = u), s[n][o] > a ? (e ? this.setDataMax(s[n][o]) : this._max = s[n][o], !1) : {
                x: n,
                y: o,
                value: l,
                radius: u,
                min: h,
                max: a
              }
            }, _unOrganizeData: function () {
              var t = [], e = this._data, i = this._radi;
              for (var n in e)for (var o in e[n])t.push({x: n, y: o, radius: i[n][o], value: e[n][o]});
              return {min: this._min, max: this._max, data: t}
            }, _onExtremaChange: function () {
              this._coordinator.emit("extremachange", {min: this._min, max: this._max})
            }, addData: function () {
              if (arguments[0].length > 0)for (var t = arguments[0],
                                                 e = t.length; e--;)this.addData.call(this, t[e]); else {
                var i = this._organiseData(arguments[0], !0);
                i && this._coordinator.emit("renderpartial", {
                  min: this._min,
                  max: this._max,
                  data: [i]
                })
              }
              return this
            }, setData: function (t) {
              var e = t.data, i = e.length;
              this._data = [], this._radi = [];
              for (var n = 0; n < i; n++)this._organiseData(e[n], !1);
              return this._max = t.max, this._min = t.min || 0, this._onExtremaChange(), this._coordinator.emit("renderall", this._getInternalData()), this
            }, removeData: function () {
            }, setDataMax: function (t) {
              return this._max = t, this._onExtremaChange(), this._coordinator.emit("renderall", this._getInternalData()), this
            }, setDataMin: function (t) {
              return this._min = t, this._onExtremaChange(), this._coordinator.emit("renderall", this._getInternalData()), this
            }, setCoordinator: function (t) {
              this._coordinator = t
            }, _getInternalData: function () {
              return {max: this._max, min: this._min, data: this._data, radi: this._radi}
            }, getData: function () {
              return this._unOrganizeData()
            }
          }, e
        }(), i = function () {
          function t(t) {
            var i = t.container, n = this.shadowCanvas = document.createElement("canvas"),
              o = this.canvas = t.canvas || document.createElement("canvas"),
              r = (this._renderBoundaries = [1e4, 1e4, 0, 0], getComputedStyle(t.container) || {});
            o.className = "heatmap-canvas", this._width = o.width = n.width = +r.width.replace(/px/, ""), this._height = o.height = n.height = +r.height.replace(/px/, ""), this.shadowCtx = n.getContext("2d"), this.ctx = o.getContext("2d"), o.style.cssText = n.style.cssText = "position:absolute;left:0;top:0;", i.style.position = "relative", i.appendChild(o), this._palette = e(t), this._templates = {}, this._setStyles(t)
          }

          var e = function (t) {
            var e = t.gradient || t.defaultGradient, i = document.createElement("canvas"), n = i.getContext("2d");
            i.width = 256, i.height = 1;
            var o = n.createLinearGradient(0, 0, 256, 1);
            for (var r in e)o.addColorStop(r, e[r]);
            return n.fillStyle = o, n.fillRect(0, 0, 256, 1), n.getImageData(0, 0, 256, 1).data
          }, i = function (t, e) {
            var i = document.createElement("canvas"), n = i.getContext("2d"), o = t, r = t;
            if (i.width = i.height = 2 * t, 1 == e) n.beginPath(), n.arc(o, r, t, 0, 2 * Math.PI, !1), n.fillStyle = "rgba(0,0,0,1)", n.fill(); else {
              var s = n.createRadialGradient(o, r, t * e, o, r, t);
              s.addColorStop(0, "rgba(0,0,0,1)"), s.addColorStop(1, "rgba(0,0,0,0)"), n.fillStyle = s, n.fillRect(0, 0, 2 * t, 2 * t)
            }
            return i
          }, n = function (t) {
            for (var e = [], i = t.min, n = t.max, o = t.radi, t = t.data, r = Object.keys(t),
                   s = r.length; s--;)for (var a = r[s], h = Object.keys(t[a]), l = h.length; l--;) {
              var u = h[l], c = t[a][u], p = o[a][u];
              e.push({x: a, y: u, value: c, radius: 40})
            }
            return {min: i, max: n, data: e}
          };
          return t.prototype = {
            renderPartial: function (t) {
              this._drawAlpha(t), this._colorize()
            }, renderAll: function (t) {
              this._clear(), this._drawAlpha(n(t)), this._colorize()
            }, _updateGradient: function (t) {
              this._palette = e(t)
            }, updateConfig: function (t) {
              t.gradient && this._updateGradient(t), this._setStyles(t)
            }, setDimensions: function (t, e) {
              this._width = t, this._height = e, this.canvas.width = this.shadowCanvas.width = t, this.canvas.height = this.shadowCanvas.height = e
            }, _clear: function () {
              this.shadowCtx.clearRect(0, 0, this._width, this._height), this.ctx.clearRect(0, 0, this._width, this._height)
            }, _setStyles: function (t) {
              this._blur = 0 == t.blur ? 0 : t.blur || t.defaultBlur, t.backgroundColor && (this.canvas.style.backgroundColor = t.backgroundColor), this._opacity = 255 * (t.opacity || 0), this._maxOpacity = 255 * (t.maxOpacity || t.defaultMaxOpacity), this._minOpacity = 255 * (t.minOpacity || t.defaultMinOpacity), this._useGradientOpacity = !!t.useGradientOpacity
            }, _drawAlpha: function (t) {
              for (var e = this._min = t.min, n = this._max = t.max, t = t.data || [], o = t.length,
                     r = 1 - this._blur; o--;) {
                var s, a = t[o], h = a.x, l = a.y, u = a.radius, c = Math.min(a.value, n), p = h - u, d = l - u,
                  f = this.shadowCtx;
                this._templates[u] ? s = this._templates[u] : this._templates[u] = s = i(u, r), f.globalAlpha = (c - e) / (n - e), f.drawImage(s, p, d), p < this._renderBoundaries[0] && (this._renderBoundaries[0] = p), d < this._renderBoundaries[1] && (this._renderBoundaries[1] = d), p + 2 * u > this._renderBoundaries[2] && (this._renderBoundaries[2] = p + 2 * u), d + 2 * u > this._renderBoundaries[3] && (this._renderBoundaries[3] = d + 2 * u)
              }
            }, _colorize: function () {
              var t = this._renderBoundaries[0], e = this._renderBoundaries[1], i = this._renderBoundaries[2] - t,
                n = this._renderBoundaries[3] - e, o = this._width, r = this._height, s = this._opacity,
                a = this._maxOpacity, h = this._minOpacity, l = this._useGradientOpacity;
              t < 0 && (t = 0), e < 0 && (e = 0), t + i > o && (i = o - t), e + n > r && (n = r - e);
              for (var u = this.shadowCtx.getImageData(t, e, i, n), c = u.data, p = c.length, d = this._palette,
                     f = 3; f < p; f += 4) {
                var _ = c[f], m = 4 * _;
                if (m) {
                  var g;
                  g = s > 0 ? s : _ < a ? _ < h ? h : _ : a, c[f - 3] = d[m], c[f - 2] = d[m + 1], c[f - 1] = d[m + 2], c[f] = l ? d[m + 3] : g
                }
              }
              ;
              // 不知道为什么这里设置了一个readOnly的属性导致报错，注释后通过
              // u.data = c,
                this.ctx.putImageData(u, t, e),
                this._renderBoundaries = [1e3, 1e3, 0, 0]
            }, getValueAt: function (t) {
              var e, i = this.shadowCtx, n = i.getImageData(t.x, t.y, 1, 1), o = n.data[3], r = this._max,
                s = this._min;
              return e = Math.abs(r - s) * (o / 255) >> 0
            }, getDataURL: function () {
              return this.canvas.toDataURL()
            }
          }, t
        }(), n = function () {
          var e = !1;
          return "canvas2d" === t.defaultRenderer && (e = i), e
        }(), o = {
          merge: function () {
            for (var t = {}, e = arguments.length, i = 0; i < e; i++) {
              var n = arguments[i];
              for (var o in n)t[o] = n[o]
            }
            return t
          }
        }, r = function () {
          function i() {
            var i = this._config = o.merge(t, arguments[0] || {});
            if (this._coordinator = new r, i.plugin) {
              var a = i.plugin;
              if (!t.plugins[a])throw new Error("Plugin '" + a + "' not found. Maybe it was not registered.");
              var h = t.plugins[a];
              this._renderer = new h.renderer(i), this._store = new h.store(i)
            } else this._renderer = new n(i), this._store = new e(i);
            s(this)
          }

          var r = function () {
            function t() {
              this.cStore = {}
            }

            return t.prototype = {
              on: function (t, e, i) {
                var n = this.cStore;
                n[t] || (n[t] = []), n[t].push(function (t) {
                  return e.call(i, t)
                })
              }, emit: function (t, e) {
                var i = this.cStore;
                if (i[t])for (var n = i[t].length, o = 0; o < n; o++) {
                  var r = i[t][o];
                  r(e)
                }
              }
            }, t
          }(), s = function (t) {
            var e = t._renderer, i = t._coordinator, n = t._store;
            i.on("renderpartial", e.renderPartial, e), i.on("renderall", e.renderAll, e), i.on("extremachange", function (e) {
              t._config.onExtremaChange && t._config.onExtremaChange({
                min: e.min,
                max: e.max,
                gradient: t._config.gradient || t._config.defaultGradient
              })
            }), n.setCoordinator(i)
          };
          return i.prototype = {
            addData: function () {
              return this._store.addData.apply(this._store, arguments), this
            }, removeData: function () {
              return this._store.removeData && this._store.removeData.apply(this._store, arguments), this
            }, setData: function () {
              return this._store.setData.apply(this._store, arguments), this
            }, setDataMax: function () {
              return this._store.setDataMax.apply(this._store, arguments), this
            }, setDataMin: function () {
              return this._store.setDataMin.apply(this._store, arguments), this
            }, configure: function (t) {
              return this._config = o.merge(this._config, t), this._renderer.updateConfig(this._config), this._coordinator.emit("renderall", this._store._getInternalData()), this
            }, repaint: function () {
              return this._coordinator.emit("renderall", this._store._getInternalData()), this
            }, getData: function () {
              return this._store.getData()
            }, getDataURL: function () {
              return this._renderer.getDataURL()
            }, getValueAt: function (t) {
              return this._store.getValueAt ? this._store.getValueAt(t) : this._renderer.getValueAt ? this._renderer.getValueAt(t) : null
            }
          }, i
        }(), s = {
          create: function (t) {
            return new r(t)
          }, register: function (e, i) {
            t.plugins[e] = i
          }
        };
        return s
      })
    }, {}], 22: [function (t, e, i) {
      !function (t, i, n) {
        var o = t.L, r = {};
        "object" == typeof e && "object" == typeof e.exports ? e.exports = r : "function" == typeof define && define.amd && define(r), r.noConflict = function () {
          return t.L = o, this
        }, t.L = r, r.Util = {
          extend: function (t) {
            var e, i, n, o, r = Array.prototype.slice.call(arguments, 1);
            for (i = 0, n = r.length; i < n; i++) {
              o = r[i] || {};
              for (e in o)o.hasOwnProperty(e) && (t[e] = o[e])
            }
            return t
          }, bind: function (t, e) {
            var i = arguments.length > 2 ? Array.prototype.slice.call(arguments, 2) : null;
            return function () {
              return t.apply(e, i || arguments)
            }
          }, stamp: function () {
            var t = 0, e = "_ngr_id";
            return function (i) {
              return i[e] = i[e] || ++t, i[e]
            }
          }(), invokeEach: function (t, e, i) {
            var n, o;
            if ("object" == typeof t) {
              o = Array.prototype.slice.call(arguments, 3);
              for (n in t)e.apply(i, [n, t[n]].concat(o));
              return !0
            }
            return !1
          }, limitExecByInterval: function (t, e, i) {
            var n, o;
            return function r() {
              var s = arguments;
              return n ? void(o = !0) : (n = !0, setTimeout(function () {
                n = !1, o && (r.apply(i, s), o = !1)
              }, e), void t.apply(i, s))
            }
          }, falseFn: function () {
            return !1
          }, formatNum: function (t, e) {
            var i = Math.pow(10, e || 5);
            return Math.round(t * i) / i
          }, trim: function (t) {
            return t.trim ? t.trim() : t.replace(/^\s+|\s+$/g, "")
          }, splitWords: function (t) {
            return r.Util.trim(t).split(/\s+/)
          }, setOptions: function (t, e) {
            return t.options = r.extend({}, t.options, e), t.options
          }, getParamString: function (t, e, i) {
            var n = [];
            for (var o in t)n.push(encodeURIComponent(i ? o.toUpperCase() : o) + "=" + encodeURIComponent(t[o]));
            return (e && e.indexOf("?") !== -1 ? "&" : "?") + n.join("&")
          }, template: function (t, e) {
            return t.replace(/\{ *([\w_]+) *\}/g, function (t, i) {
              var o = e[i];
              if (o === n)throw new Error("No value provided for variable " + t);
              return "function" == typeof o && (o = o(e)), o
            })
          }, isArray: Array.isArray || function (t) {
            return "[object Array]" === Object.prototype.toString.call(t)
          }, emptyImageUrl: ""
        }, function () {
          function e(e) {
            var i, n, o = ["webkit", "moz", "o", "ms"];
            for (i = 0; i < o.length && !n; i++)n = t[o[i] + e];
            return n
          }

          function i(e) {
            var i = +new Date, o = Math.max(0, 16 - (i - n));
            return n = i + o, t.setTimeout(e, o)
          }

          var n = 0, o = t.requestAnimationFrame || e("RequestAnimationFrame") || i,
            s = t.cancelAnimationFrame || e("CancelAnimationFrame") || e("CancelRequestAnimationFrame") || function (e) {
                t.clearTimeout(e)
              };
          r.Util.requestAnimFrame = function (e, n, s, a) {
            return e = r.bind(e, n), s && o === i ? void e() : o.call(t, e, a)
          }, r.Util.cancelAnimFrame = function (e) {
            e && s.call(t, e)
          }
        }(), r.extend = r.Util.extend, r.bind = r.Util.bind, r.stamp = r.Util.stamp, r.setOptions = r.Util.setOptions, r.Class = function () {
        }, r.Class.extend = function (t) {
          var e = function () {
            this.initialize && this.initialize.apply(this, arguments), this._initHooks && this.callInitHooks()
          }, i = function () {
          };
          i.prototype = this.prototype;
          var n = new i;
          n.constructor = e, e.prototype = n;
          for (var o in this)this.hasOwnProperty(o) && "prototype" !== o && (e[o] = this[o]);
          t.statics && (r.extend(e, t.statics), delete t.statics), t.includes && (r.Util.extend.apply(null, [n].concat(t.includes)), delete t.includes), t.options && n.options && (t.options = r.extend({}, n.options, t.options)), r.extend(n, t), n._initHooks = [];
          var s = this;
          return e.__super__ = s.prototype, n.callInitHooks = function () {
            if (!this._initHooksCalled) {
              s.prototype.callInitHooks && s.prototype.callInitHooks.call(this), this._initHooksCalled = !0;
              for (var t = 0, e = n._initHooks.length; t < e; t++)n._initHooks[t].call(this)
            }
          }, e
        }, r.Class.include = function (t) {
          r.extend(this.prototype, t)
        }, r.Class.mergeOptions = function (t) {
          r.extend(this.prototype.options, t)
        }, r.Class.addInitHook = function (t) {
          var e = Array.prototype.slice.call(arguments, 1), i = "function" == typeof t ? t : function () {
            this[t].apply(this, e)
          };
          this.prototype._initHooks = this.prototype._initHooks || [], this.prototype._initHooks.push(i)
        };
        var s = "_ngr_events";
        r.Mixin = {}, r.Mixin.Events = {
          addEventListener: function (t, e, i) {
            // 每个layer的on绑定(dom事件转为ngr事件), i为当前地图, t为事件类型, e为dom事件的回调
            if (r.Util.invokeEach(t, this.addEventListener, this, e, i))return this;
            var n, o, a, h, l, u, c, p = this[s] = this[s] || {}, d = i && i !== this && r.stamp(i);
            for (t = r.Util.splitWords(t), n = 0, o = t.length; n < o; n++)a = {
              action: e,
              context: i || this
            }, h = t[n], d ? (l = h + "_idx", u = l + "_len", c = p[l] = p[l] || {}, c[d] || (c[d] = [], p[u] = (p[u] || 0) + 1), c[d].push(a)) : (p[h] = p[h] || [], p[h].push(a));
            return this
          }, hasEventListeners: function (t) {
            var e = this[s];
            return !!e && (t in e && e[t].length > 0 || t + "_idx" in e && e[t + "_idx_len"] > 0)
          }, removeEventListener: function (t, e, i) {
            if (!this[s])return this;
            if (!t)return this.clearAllEventListeners();
            if (r.Util.invokeEach(t, this.removeEventListener, this, e, i))return this;
            var n, o, a, h, l, u, c, p, d, f = this[s], _ = i && i !== this && r.stamp(i);
            for (t = r.Util.splitWords(t), n = 0, o = t.length; n < o; n++)if (a = t[n], u = a + "_idx", c = u + "_len", p = f[u], e) {
              if (h = _ && p ? p[_] : f[a]) {
                for (l = h.length - 1; l >= 0; l--)h[l].action !== e || i && h[l].context !== i || (d = h.splice(l, 1), d[0].action = r.Util.falseFn);
                i && p && 0 === h.length && (delete p[_], f[c]--)
              }
            } else delete f[a], delete f[u], delete f[c];
            return this
          }, clearAllEventListeners: function () {
            return delete this[s], this
          }, fireEvent: function (t, e) {
            // dom事件已经转为canvas事件
            if (!this.hasEventListeners(t))return this;
            var i, n, o, a, h, l = r.Util.extend({}, e, {type: t, target: this}), u = this[s];
            if (u[t])for (i = u[t].slice(), n = 0, o = i.length; n < o; n++)i[n].action.call(i[n].context, l);
            a = u[t + "_idx"];
            for (h in a)if (i = a[h].slice())for (n = 0, o = i.length; n < o; n++)i[n].action.call(i[n].context, l);
            return this
          }, addOneTimeEventListener: function (t, e, i) {
            if (r.Util.invokeEach(t, this.addOneTimeEventListener, this, e, i))return this;
            var n = r.bind(function () {
              this.removeEventListener(t, e, i).removeEventListener(t, n, i)
            }, this);
            return this.addEventListener(t, e, i).addEventListener(t, n, i)
          }
        }, r.Mixin.Events.on = r.Mixin.Events.addEventListener, r.Mixin.Events.off = r.Mixin.Events.removeEventListener, r.Mixin.Events.once = r.Mixin.Events.addOneTimeEventListener, r.Mixin.Events.fire = r.Mixin.Events.fireEvent, function () {
          var e = "ActiveXObject" in t, o = e && !i.addEventListener, s = navigator.userAgent.toLowerCase(),
            a = s.indexOf("webkit") !== -1, h = s.indexOf("chrome") !== -1, l = s.indexOf("phantom") !== -1,
            u = s.indexOf("android") !== -1, c = s.search("android [23]") !== -1, p = s.indexOf("gecko") !== -1,
            d = typeof orientation != n + "",
            f = t.navigator && t.navigator.msPointerEnabled && t.navigator.msMaxTouchPoints && !t.PointerEvent,
            _ = t.PointerEvent && t.navigator.pointerEnabled && t.navigator.maxTouchPoints || f,
            m = "devicePixelRatio" in t && t.devicePixelRatio > 1 || "matchMedia" in t && t.matchMedia("(min-resolution:144dppi)") && t.matchMedia("(min-resolution:144dppi)").matches,
            g = i.documentElement, y = e && "transition" in g.style,
            v = "WebKitCSSMatrix" in t && "m11" in new t.WebKitCSSMatrix && !c, L = "MozPerspective" in g.style,
            M = "OTransition" in g.style, w = !t.L_DISABLE_3D && (y || v || L || M) && !l,
            C = !t.L_NO_TOUCH && !l && function () {
                var t = "ontouchstart";
                if (_ || t in g)return !0;
                var e = i.createElement("div"), n = !1;
                return !!e.setAttribute && (e.setAttribute(t, "return;"), "function" == typeof e[t] && (n = !0), e.removeAttribute(t), e = null, n)
              }();
          r.Browser = {
            ie: e,
            ielt9: o,
            webkit: a,
            gecko: p && !a && !t.opera && !e,
            android: u,
            android23: c,
            chrome: h,
            ie3d: y,
            webkit3d: v,
            gecko3d: L,
            opera3d: M,
            any3d: w,
            mobile: d,
            mobileWebkit: d && a,
            mobileWebkit3d: d && v,
            mobileOpera: d && t.opera,
            touch: C,
            msPointer: f,
            pointer: _,
            retina: m
          }
        }(), r.Algorithm = {
          pointDistance: function (t, e, i) {
            if ("x" in t && "x" in e && "y" in t && "y" in e)return Math.sqrt(Math.pow(t.x - e.x, 2) + Math.pow(t.y - e.y, 2));
            var n, o = 0;
            if ((n = t.length) !== e.length)return NaN;
            for (var r = 0; r < n; ++r)o += Math.pow(t[r] - e[r], 2);
            return i ? o : Math.sqrt(o)
          }, pointSegmentDistance: function (t, e, i) {
            var n, o, s;
            if (s = r.Algorithm.pointDistance(e, i), s <= 1e-7)return 0;
            if (o = r.Algorithm.pointDistance(t, i), o <= 1e-7)return 0;
            if (n = r.Algorithm.pointDistance(t, e), n <= 1e-7)return o;
            if (s * s >= o * o + n * n)return o;
            if (o * o >= s * s + n * n)return s;
            var a = (n + o + s) / 2;
            return 2 * Math.sqrt(Math.abs(a * (a - n) * (a - o) * (a - s))) / n
          }, dotProduct: function (t, e) {
            if ("x" in t && "x" in e && "y" in t && "y" in e)return t.x * e.x + t.y * e.y;
            var i, n = 0;
            if ((i = t.length) !== e.length)return NaN;
            for (var o = 0; o < i; ++o)n += t[o] * e[o];
            return n
          }, pointInTriangle: function (t, e, i, n) {
            var o = [(i.x || i[0]) - (t.x || t[0]), (i.y || i[1]) - (t.y || t[1])],
              s = [(e.x || e[0]) - (t.x || t[0]), (e.y || e[1]) - (t.y || t[1])],
              a = [(n.x || n[0]) - (t.x || t[0]), (n.y || n[1]) - (t.y || t[1])], h = r.Algorithm.dotProduct(o, o),
              l = r.Algorithm.dotProduct(o, s), u = r.Algorithm.dotProduct(o, a), c = r.Algorithm.dotProduct(s, s),
              p = r.Algorithm.dotProduct(s, a), d = 1 / (h * c - l * l), f = (c * u - l * p) * d;
            if (f < 0 || f > 1)return !1;
            var _ = (h * p - l * u) * d;
            return !(_ < 0 || _ > 1) && f + _ <= 1
          }, signOfDet2x2: function (t, e, i, n) {
            var o = 1, r = 0, s = 0;
            if (isNaN(t) || isNaN(e) || isNaN(i) || isNaN(n) || !isFinite(t) || !isFinite(e) || !isFinite(i) || !isFinite(n))throw new Error("RobustDeterminant encountered non-finite numbers");
            if (0 === t || 0 === n)return 0 === e || 0 === i ? 0 : e > 0 ? i > 0 ? -o : o : i > 0 ? o : -o;
            if (0 === e || 0 === i)return n > 0 ? t > 0 ? o : -o : t > 0 ? -o : o;
            if (0 < e ? 0 < n ? e <= n || (o = -o, r = t, t = i, i = r, r = e, e = n, n = r) : e <= -n ? (o = -o, i = -i, n = -n) : (r = t, t = -i, i = r, r = e, e = -n, n = r) : 0 < n ? -e <= n ? (o = -o, t = -t, e = -e) : (r = -t, t = i, i = r, r = -e, e = n, n = r) : e >= n ? (t = -t, e = -e, i = -i, n = -n) : (o = -o, r = -t, t = -i, i = r, r = -e, e = -n, n = r), 0 < t) {
              if (!(0 < i))return o;
              if (!(t <= i))return o
            } else {
              if (0 < i)return -o;
              if (!(t >= i))return -o;
              o = -o, t = -t, i = -i
            }
            for (; ;) {
              if (s = Math.floor(i / t), i -= s * t, n -= s * e, n < 0)return -o;
              if (n > e)return o;
              if (t > i + i) {
                if (e < n + n)return o
              } else {
                if (e > n + n)return -o;
                i = t - i, n = e - n, o = -o
              }
              if (0 === n)return 0 === i ? 0 : -o;
              if (0 === i)return o;
              if (s = Math.floor(t / i), t -= s * i, e -= s * n, e < 0)return o;
              if (e > n)return -o;
              if (i > t + t) {
                if (n < e + e)return -o
              } else {
                if (n > e + e)return o;
                t = i - t, e = n - e, o = -o
              }
              if (0 === e)return 0 === t ? 0 : o;
              if (0 === t)return -o
            }
          }
        }, r.Point = function (t, e, i) {
          this.x = i ? Math.round(t) : t, this.y = i ? Math.round(e) : e
        }, r.Point.prototype = {
          clone: function () {
            return new r.Point(this.x, this.y)
          }, add: function (t) {
            return this.clone()._add(r.point(t))
          }, _add: function (t) {
            return this.x += t.x, this.y += t.y, this
          }, subtract: function (t) {
            return this.clone()._subtract(r.point(t))
          }, _subtract: function (t) {
            return this.x -= t.x, this.y -= t.y, this
          }, divideBy: function (t) {
            return this.clone()._divideBy(t)
          }, _divideBy: function (t) {
            return this.x /= t, this.y /= t, this
          }, multiplyBy: function (t) {
            return this.clone()._multiplyBy(t)
          }, _multiplyBy: function (t) {
            return this.x *= t, this.y *= t, this
          }, round: function () {
            return this.clone()._round()
          }, _round: function () {
            return this.x = Math.round(this.x), this.y = Math.round(this.y), this
          }, floor: function () {
            return this.clone()._floor()
          }, _floor: function () {
            return this.x = Math.floor(this.x), this.y = Math.floor(this.y), this
          }, distanceTo: function (t) {
            t = r.point(t);
            var e = t.x - this.x, i = t.y - this.y;
            return Math.sqrt(e * e + i * i)
          }, equals: function (t) {
            return t = r.point(t), t.x === this.x && t.y === this.y
          }, contains: function (t) {
            return t = r.point(t), Math.abs(t.x) <= Math.abs(this.x) && Math.abs(t.y) <= Math.abs(this.y)
          }, toString: function () {
            return "Point(" + r.Util.formatNum(this.x) + ", " + r.Util.formatNum(this.y) + ")"
          }
        }, r.point = function (t, e, i) {
          return t instanceof r.Point ? t : r.Util.isArray(t) ? new r.Point(t[0], t[1]) : t === n || null === t ? t : new r.Point(t, e, i)
        }, r.Bounds = function (t, e) {
          if (t)for (var i = e ? [t, e] : t, n = 0, o = i.length; n < o; n++)this.extend(i[n])
        }, r.Bounds.prototype = {
          extend: function (t) {
            return t = r.point(t), this.min || this.max ? (this.min.x = Math.min(t.x, this.min.x), this.max.x = Math.max(t.x, this.max.x), this.min.y = Math.min(t.y, this.min.y), this.max.y = Math.max(t.y, this.max.y)) : (this.min = t.clone(), this.max = t.clone()), this
          }, getCenter: function (t) {
            return new r.Point((this.min.x + this.max.x) / 2, (this.min.y + this.max.y) / 2, t)
          }, getBottomLeft: function () {
            return new r.Point(this.min.x, this.max.y)
          }, getTopRight: function () {
            return new r.Point(this.max.x, this.min.y)
          }, getSize: function () {
            return this.max.subtract(this.min)
          }, contains: function (t) {
            var e, i;
            return t = "number" == typeof t[0] || t instanceof r.Point ? r.point(t) : r.bounds(t), t instanceof r.Bounds ? (e = t.min, i = t.max) : e = i = t, e.x >= this.min.x && i.x <= this.max.x && e.y >= this.min.y && i.y <= this.max.y
          }, intersects: function (t) {
            t = r.bounds(t);
            var e = this.min, i = this.max, n = t.min, o = t.max, s = o.x >= e.x && n.x <= i.x,
              a = o.y >= e.y && n.y <= i.y;
            return s && a
          }, isValid: function () {
            return !(!this.min || !this.max)
          }
        }, r.bounds = function (t, e) {
          return !t || t instanceof r.Bounds ? t : new r.Bounds(t, e)
        }, r.Transformation = function (t, e, i, n) {
          this._a = t, this._b = e, this._c = i, this._d = n
        }, r.Transformation.prototype = {
          transform: function (t, e) {
            return this._transform(t.clone(), e)
          }, _transform: function (t, e) {
            return e = e || 1, t.x = e * (this._a * t.x + this._b), t.y = e * (this._c * t.y + this._d), t
          }, untransform: function (t, e) {
            return e = e || 1, new r.Point((t.x / e - this._b) / this._a, (t.y / e - this._d) / this._c)
          }
        }, r.DomUtil = {
          get: function (t) {
            return "string" == typeof t ? i.getElementById(t) : t
          }, getStyle: function (t, e) {
            var n = t.style[e];
            if (!n && t.currentStyle && (n = t.currentStyle[e]), (!n || "auto" === n) && i.defaultView) {
              var o = i.defaultView.getComputedStyle(t, null);
              n = o ? o[e] : null
            }
            return "auto" === n ? null : n
          }, getViewportOffset: function (t) {
            var e, n = 0, o = 0, s = t, a = i.body, h = i.documentElement;
            do {
              if (n += s.offsetTop || 0, o += s.offsetLeft || 0, n += parseInt(r.DomUtil.getStyle(s, "borderTopWidth"), 10) || 0, o += parseInt(r.DomUtil.getStyle(s, "borderLeftWidth"), 10) || 0, e = r.DomUtil.getStyle(s, "position"), s.offsetParent === a && "absolute" === e)break;
              if ("fixed" === e) {
                n += a.scrollTop || h.scrollTop || 0, o += a.scrollLeft || h.scrollLeft || 0;
                break
              }
              if ("relative" === e && !s.offsetLeft) {
                var l = r.DomUtil.getStyle(s, "width"), u = r.DomUtil.getStyle(s, "max-width"),
                  c = s.getBoundingClientRect();
                "none" === l && "none" === u || (o += c.left + s.clientLeft), n += c.top + (a.scrollTop || h.scrollTop || 0);
                break
              }
              s = s.offsetParent
            } while (s);
            s = t;
            do {
              if (s === a)break;
              n -= s.scrollTop || 0, o -= s.scrollLeft || 0, s = s.parentNode
            } while (s);
            return new r.Point(o, n)
          }, documentIsLtr: function () {
            return r.DomUtil._docIsLtrCached || (r.DomUtil._docIsLtrCached = !0, r.DomUtil._docIsLtr = "ltr" === r.DomUtil.getStyle(i.body, "direction")), r.DomUtil._docIsLtr
          }, create: function (t, e, n) {
            var o = i.createElement(t);
            return o.className = e, n && n.appendChild(o), o
          }, hasClass: function (t, e) {
            if (t.classList !== n)return t.classList.contains(e);
            var i = r.DomUtil._getClass(t);
            return i.length > 0 && new RegExp("(^|\\s)" + e + "(\\s|$)").test(i)
          }, addClass: function (t, e) {
            if (t.classList !== n)for (var i = r.Util.splitWords(e), o = 0,
                                         s = i.length; o < s; o++)t.classList.add(i[o]); else if (!r.DomUtil.hasClass(t, e)) {
              var a = r.DomUtil._getClass(t);
              r.DomUtil._setClass(t, (a ? a + " " : "") + e)
            }
          }, removeClass: function (t, e) {
            t.classList !== n ? t.classList.remove(e) : r.DomUtil._setClass(t, r.Util.trim((" " + r.DomUtil._getClass(t) + " ").replace(" " + e + " ", " ")))
          }, _setClass: function (t, e) {
            t.className.baseVal === n ? t.className = e : t.className.baseVal = e
          }, _getClass: function (t) {
            return t.className.baseVal === n ? t.className : t.className.baseVal
          }, setOpacity: function (t, e) {
            if ("opacity" in t.style) t.style.opacity = e; else if ("filter" in t.style) {
              var i = !1, n = "DXImageTransform.Microsoft.Alpha";
              try {
                i = t.filters.item(n)
              } catch (o) {
                if (1 === e)return
              }
              e = Math.round(100 * e), i ? (i.Enabled = 100 !== e, i.Opacity = e) : t.style.filter += " progid:" + n + "(opacity=" + e + ")"
            }
          }, testProp: function (t) {
            for (var e = i.documentElement.style, n = 0; n < t.length; n++)if (t[n] in e)return t[n];
            return !1
          }, getTranslateString: function (t) {
            var e = r.Browser.webkit3d, i = "translate" + (e ? "3d" : "") + "(", n = (e ? ",0" : "") + ")";
            return i + t.x + "px," + t.y + "px" + n
          }, getScaleString: function (t, e) {
            var i = r.DomUtil.getTranslateString(e.add(e.multiplyBy(-1 * t))), n = " scale(" + t + ") ";
            return i + n
          }, setPosition: function (t, e, i) {
            t._ngr_pos = e, !i && r.Browser.any3d ? t.style[r.DomUtil.TRANSFORM] = r.DomUtil.getTranslateString(e) : (t.style.left = e.x + "px", t.style.top = e.y + "px")
          }, getPosition: function (t) {
            return t._ngr_pos
          }
        }, r.DomUtil.TRANSFORM = r.DomUtil.testProp(["transform", "WebkitTransform", "OTransform", "MozTransform", "msTransform"]), r.DomUtil.TRANSITION = r.DomUtil.testProp(["webkitTransition", "transition", "OTransition", "MozTransition", "msTransition"]), r.DomUtil.TRANSITION_END = "webkitTransition" === r.DomUtil.TRANSITION || "OTransition" === r.DomUtil.TRANSITION ? r.DomUtil.TRANSITION + "End" : "transitionend", function () {
          if ("onselectstart" in i) r.extend(r.DomUtil, {
            disableTextSelection: function () {
              r.DomEvent.on(t, "selectstart", r.DomEvent.preventDefault)
            }, enableTextSelection: function () {
              r.DomEvent.off(t, "selectstart", r.DomEvent.preventDefault)
            }
          }); else {
            var e = r.DomUtil.testProp(["userSelect", "WebkitUserSelect", "OUserSelect", "MozUserSelect", "msUserSelect"]);
            r.extend(r.DomUtil, {
              disableTextSelection: function () {
                if (e) {
                  var t = i.documentElement.style;
                  this._userSelect = t[e], t[e] = "none"
                }
              }, enableTextSelection: function () {
                e && (i.documentElement.style[e] = this._userSelect, delete this._userSelect)
              }
            })
          }
          r.extend(r.DomUtil, {
            disableImageDrag: function () {
              r.DomEvent.on(t, "dragstart", r.DomEvent.preventDefault)
            }, enableImageDrag: function () {
              r.DomEvent.off(t, "dragstart", r.DomEvent.preventDefault)
            }
          })
        }(), r.LatLng = function (t, e, i) {
          if (t = parseFloat(t), e = parseFloat(e), isNaN(t) || isNaN(e))throw new Error("Invalid LatLng object: (" + t + ", " + e + ")");
          this.lat = t, this.lng = e, i !== n && (this.alt = parseFloat(i))
        }, r.extend(r.LatLng, {
          DEG_TO_RAD: Math.PI / 180,
          RAD_TO_DEG: 180 / Math.PI,
          MAX_MARGIN: 1e-9
        }), r.LatLng.prototype = {
          equals: function (t) {
            if (!t)return !1;
            t = r.latLng(t);
            var e = Math.max(Math.abs(this.lat - t.lat), Math.abs(this.lng - t.lng));
            return e <= r.LatLng.MAX_MARGIN
          }, toString: function (t) {
            return "LatLng(" + r.Util.formatNum(this.lat, t) + ", " + r.Util.formatNum(this.lng, t) + ")"
          }, distanceTo: function (t) {
            t = r.latLng(t);
            var e = 6378137, i = r.LatLng.DEG_TO_RAD, n = (t.lat - this.lat) * i, o = (t.lng - this.lng) * i,
              s = this.lat * i, a = t.lat * i, h = Math.sin(n / 2), l = Math.sin(o / 2),
              u = h * h + l * l * Math.cos(s) * Math.cos(a);
            return 2 * e * Math.atan2(Math.sqrt(u), Math.sqrt(1 - u))
          }, wrap: function (t, e) {
            var i = this.lng;
            return t = t || -180, e = e || 180, i = (i + e) % (e - t) + (i < t || i === e ? e : t), new r.LatLng(this.lat, i)
          }
        }, r.latLng = function (t, e) {
          return t instanceof r.LatLng ? t : r.Util.isArray(t) ? "number" == typeof t[0] || "string" == typeof t[0] ? new r.LatLng(t[0], t[1], t[2]) : null : t === n || null === t ? t : "object" == typeof t && "lat" in t ? new r.LatLng(t.lat, "lng" in t ? t.lng : t.lon) : e === n ? null : new r.LatLng(t, e)
        }, r.LatLngBounds = function (t, e) {
          if (t)for (var i = e ? [t, e] : t, n = 0, o = i.length; n < o; n++)this.extend(i[n])
        }, r.LatLngBounds.prototype = {
          extend: function (t) {
            if (!t)return this;
            var e = r.latLng(t);
            return t = null !== e ? e : r.latLngBounds(t), t instanceof r.LatLng ? this._southWest || this._northEast ? (this._southWest.lat = Math.min(t.lat, this._southWest.lat), this._southWest.lng = Math.min(t.lng, this._southWest.lng), this._northEast.lat = Math.max(t.lat, this._northEast.lat), this._northEast.lng = Math.max(t.lng, this._northEast.lng)) : (this._southWest = new r.LatLng(t.lat, t.lng), this._northEast = new r.LatLng(t.lat, t.lng)) : t instanceof r.LatLngBounds && (this.extend(t._southWest), this.extend(t._northEast)), this
          }, pad: function (t) {
            var e = this._southWest, i = this._northEast, n = Math.abs(e.lat - i.lat) * t,
              o = Math.abs(e.lng - i.lng) * t;
            return new r.LatLngBounds(new r.LatLng(e.lat - n, e.lng - o), new r.LatLng(i.lat + n, i.lng + o))
          }, getCenter: function () {
            return new r.LatLng((this._southWest.lat + this._northEast.lat) / 2, (this._southWest.lng + this._northEast.lng) / 2)
          }, getSouthWest: function () {
            return this._southWest
          }, getNorthEast: function () {
            return this._northEast
          }, getNorthWest: function () {
            return new r.LatLng(this.getNorth(), this.getWest())
          }, getSouthEast: function () {
            return new r.LatLng(this.getSouth(), this.getEast())
          }, getWest: function () {
            return this._southWest.lng
          }, getSouth: function () {
            return this._southWest.lat
          }, getEast: function () {
            return this._northEast.lng
          }, getNorth: function () {
            return this._northEast.lat
          }, contains: function (t) {
            t = "number" == typeof t[0] || t instanceof r.LatLng ? r.latLng(t) : r.latLngBounds(t);
            var e, i, n = this._southWest, o = this._northEast;
            return t instanceof r.LatLngBounds ? (e = t.getSouthWest(), i = t.getNorthEast()) : e = i = t, e.lat >= n.lat && i.lat <= o.lat && e.lng >= n.lng && i.lng <= o.lng
          }, intersects: function (t) {
            t = r.latLngBounds(t);
            var e = this._southWest, i = this._northEast, n = t.getSouthWest(), o = t.getNorthEast(),
              s = o.lat >= e.lat && n.lat <= i.lat, a = o.lng >= e.lng && n.lng <= i.lng;
            return s && a
          }, toBBoxString: function () {
            return [this.getWest(), this.getSouth(), this.getEast(), this.getNorth()].join(",")
          }, equals: function (t) {
            return !!t && (t = r.latLngBounds(t), this._southWest.equals(t.getSouthWest()) && this._northEast.equals(t.getNorthEast()))
          }, isValid: function () {
            return !(!this._southWest || !this._northEast)
          }
        }, r.latLngBounds = function (t, e) {
          return !t || t instanceof r.LatLngBounds ? t : new r.LatLngBounds(t, e)
        }, r.Projection = {}, r.Projection.SphericalMercator = {
          MAX_LATITUDE: 85.0511287798,
          project: function (t) {
            var e = r.LatLng.DEG_TO_RAD, i = this.MAX_LATITUDE, n = Math.max(Math.min(i, t.lat), -i), o = t.lng * e,
              s = n * e;
            return s = Math.log(Math.tan(Math.PI / 4 + s / 2)), new r.Point(o, s)
          },
          unproject: function (t) {
            var e = r.LatLng.RAD_TO_DEG, i = t.x * e, n = (2 * Math.atan(Math.exp(t.y)) - Math.PI / 2) * e;
            return new r.LatLng(n, i)
          }
        }, r.Projection.LonLat = {
          project: function (t) {
            return new r.Point(t.lng, t.lat)
          }, unproject: function (t) {
            return new r.LatLng(t.y, t.x)
          }
        }, r.CRS = {
          latLngToPoint: function (t, e) {
            var i = this.projection.project(t), n = this.scale(e);
            return this.transformation._transform(i, n)
          }, pointToLatLng: function (t, e) {
            var i = this.scale(e), n = this.transformation.untransform(t, i);
            return this.projection.unproject(n)
          }, project: function (t) {
            return this.projection.project(t)
          }, scale: function (t) {
            return 256 * Math.pow(2, t)
          }, getSize: function (t) {
            var e = this.scale(t);
            return r.point(e, e)
          }
        }, r.CRS.Simple = r.extend({}, r.CRS, {
          projection: r.Projection.LonLat,
          transformation: new r.Transformation(1, 0, (-1), 0),
          scale: function (t) {
            return Math.pow(2, t)
          }
        }), r.CRS.EPSG3857 = r.extend({}, r.CRS, {
          code: "EPSG:3857",
          projection: r.Projection.SphericalMercator,
          transformation: new r.Transformation(.5 / Math.PI, .5, -.5 / Math.PI, .5),
          project: function (t) {
            var e = this.projection.project(t), i = 6378137;
            return e.multiplyBy(i)
          },
          unproject: function (t) {
            var e = 6378137, i = r.point(t).divideBy(e);
            return this.projection.unproject(i)
          }
        }), r.CRS.EPSG900913 = r.extend({}, r.CRS.EPSG3857, {code: "EPSG:900913"}), r.CRS.EPSG4326 = r.extend({}, r.CRS, {
          code: "EPSG:4326",
          projection: r.Projection.LonLat,
          transformation: new r.Transformation(1 / 360, .5, -1 / 360, .5)
        }), r.Map = r.Class.extend({
          includes: r.Mixin.Events,
          options: {
            crs: r.CRS.EPSG3857,
            optimized: !1,
            fadeAnimation: r.DomUtil.TRANSITION && !r.Browser.android23,
            trackResize: !0,
            markerZoomAnimation: r.DomUtil.TRANSITION && r.Browser.any3d
          },
          initialize: function (t, e) {
            e = r.setOptions(this, e), this._initContainer(t), this._initLayout(), this._onResize = r.bind(this._onResize, this), this._initEvents(), e.maxBounds && this.setMaxBounds(e.maxBounds), e.center && e.zoom !== n && this.setView(r.latLng(e.center), e.zoom, {reset: !0}), this._handlers = [], this._layers = {}, this._zoomBoundLayers = {}, this._tileLayersNum = 0, this.callInitHooks(), this._addLayers(e.layers)
          },
          setView: function (t, e) {
            return e = e === n ? this.getZoom() : e, this._resetView(r.latLng(t), this._limitZoom(e)), this
          },
          setZoom: function (t, e) {
            return this._loaded ? this.setView(this.getCenter(), t, {zoom: e}) : (this._zoom = this._limitZoom(t), this)
          },
          zoomIn: function (t, e) {
            return this.setZoom(this._zoom + (t || 1), e)
          },
          zoomOut: function (t, e) {
            return this.setZoom(this._zoom - (t || 1), e)
          },
          setZoomAround: function (t, e, i) {
            var n = this.getZoomScale(e), o = this.getSize().divideBy(2),
              s = t instanceof r.Point ? t : this.latLngToContainerPoint(t), a = s.subtract(o).multiplyBy(1 - 1 / n),
              h = this.containerPointToLatLng(o.add(a));
            return this.setView(h, e, {zoom: i})
          },
          fitBounds: function (t, e) {
            e = e || {}, t = t.getBounds ? t.getBounds() : r.latLngBounds(t);
            var i = r.point(e.paddingTopLeft || e.padding || [0, 0]),
              n = r.point(e.paddingBottomRight || e.padding || [0, 0]), o = this.getBoundsZoom(t, !1, i.add(n));
            o = e.maxZoom ? Math.min(e.maxZoom, o) : o;
            var s = n.subtract(i).divideBy(2), a = this.project(t.getSouthWest(), o),
              h = this.project(t.getNorthEast(), o), l = this.unproject(a.add(h).divideBy(2).add(s), o);
            return this.setView(l, o, e)
          },
          fitWorld: function (t) {
            return this.fitBounds([[-90, -180], [90, 180]], t)
          },
          panTo: function (t, e) {
            return this.setView(t, this._zoom, {pan: e})
          },
          panBy: function (t) {
            return this.fire("movestart"), this._rawPanBy(r.point(t)), this.fire("move"), this.fire("moveend")
          },
          setMaxBounds: function (t) {
            return t = r.latLngBounds(t), this.options.maxBounds = t, t ? (this._loaded && this._panInsideMaxBounds(), this.on("moveend", this._panInsideMaxBounds, this)) : this.off("moveend", this._panInsideMaxBounds, this)
          },
          panInsideBounds: function (t, e) {
            var i = this.getCenter(), n = this._limitCenter(i, this._zoom, t);
            return i.equals(n) ? this : this.panTo(n, e)
          },
          addLayer: function (t) {
            var e = r.stamp(t);
            // 由之前_addLayer调用，t为单个图层
            return this._layers[e] ? this : (this._layers[e] = t,
            !t.options || isNaN(t.options.maxZoom) && isNaN(t.options.minZoom)
            || (this._zoomBoundLayers[e] = t, this._updateZoomLevels()),
            this.options.zoomAnimation && r.TileLayer && t instanceof r.TileLayer &&
            (this._tileLayersNum++, this._tileLayersToLoad++, t.on("load", this._onTileLayerLoad, this)),
            this._loaded && this._layerAdd(t), this)
          },
          removeLayer: function (t) {
            var e = r.stamp(t);
            return this._layers[e] ? (this._loaded && t.onRemove(this), delete this._layers[e], this._loaded && this.fire("layerremove", {layer: t}), this._zoomBoundLayers[e] && (delete this._zoomBoundLayers[e], this._updateZoomLevels()), this.options.zoomAnimation && r.TileLayer && t instanceof r.TileLayer && (this._tileLayersNum--, this._tileLayersToLoad--, t.off("load", this._onTileLayerLoad, this)), this) : this
          },
          hasLayer: function (t) {
            return !!t && r.stamp(t) in this._layers
          },
          eachLayer: function (t, e) {
            for (var i in this._layers)t.call(e, this._layers[i]);
            return this
          },
          invalidateSize: function (t) {
            if (!this._loaded)return this;
            t = r.extend({animate: !1, pan: !0}, t === !0 ? {animate: !0} : t);
            var e = this.getSize();
            this._sizeChanged = !0, this._initialCenter = null;
            var i = this.getSize(), n = e.divideBy(2).round(), o = i.divideBy(2).round(), s = n.subtract(o);
            return s.x || s.y ? (t.animate && t.pan ? this.panBy(s) : (t.pan && this._rawPanBy(s), this.fire("move"), t.debounceMoveend ? (clearTimeout(this._sizeTimer), this._sizeTimer = setTimeout(r.bind(this.fire, this, "moveend"), 200)) : this.fire("moveend")), this.fire("resize", {
              oldSize: e,
              newSize: i
            })) : this
          },
          addHandler: function (t, e) {
            if (!e)return this;
            var i = this[t] = new e(this);
            return this._handlers.push(i), this.options[t] && i.enable(), this
          },
          remove: function () {
            this._loaded && this.fire("unload"), this._initEvents("off");
            try {
              delete this._container._ngr
            } catch (t) {
              this._container._ngr = n
            }
            return this._clearPanes(), this._clearControlPos && this._clearControlPos(), this._clearHandlers(), this
          },
          getCenter: function () {
            return this._checkIfLoaded(), this._initialCenter && !this._moved() ? this._initialCenter : this.layerPointToLatLng(this._getCenterLayerPoint())
          },
          getZoom: function () {
            return this._zoom
          },
          getBounds: function () {
            var t = this.getPixelBounds(), e = this.unproject(t.getBottomLeft()), i = this.unproject(t.getTopRight());
            return new r.LatLngBounds(e, i)
          },
          getMinZoom: function () {
            return this.options.minZoom === n ? this._layersMinZoom === n ? 0 : this._layersMinZoom : this.options.minZoom
          },
          getMaxZoom: function () {
            return this.options.maxZoom === n ? this._layersMaxZoom === n ? 1 / 0 : this._layersMaxZoom : this.options.maxZoom
          },
          getBoundsZoom: function (t, e, i) {
            t = r.latLngBounds(t);
            var n, o = this.getMinZoom() - (e ? 1 : 0), s = this.getMaxZoom(), a = this.getSize(), h = t.getNorthWest(),
              l = t.getSouthEast(), u = !0;
            i = r.point(i || [0, 0]);
            do o++, n = this.project(l, o).subtract(this.project(h, o)).add(i), u = e ? n.x < a.x || n.y < a.y : a.contains(n); while (u && o <= s);
            return u && e ? null : e ? o : o - 1
          },
          getSize: function () {
            return this._size && !this._sizeChanged || (this._size = new r.Point(this._container.clientWidth, this._container.clientHeight), this._sizeChanged = !1), this._size.clone()
          },
          getPixelBounds: function () {
            var t = this._getTopLeftPoint();
            return new r.Bounds(t, t.add(this.getSize()))
          },
          getPixelOrigin: function () {
            return this._checkIfLoaded(), this._initialTopLeftPoint
          },
          getPanes: function () {
            return this._panes
          },
          getContainer: function () {
            return this._container
          },
          getZoomScale: function (t) {
            var e = this.options.crs;
            return e.scale(t) / e.scale(this._zoom)
          },
          getScaleZoom: function (t) {
            return this._zoom + Math.log(t) / Math.LN2
          },
          project: function (t, e) {
            return e = e === n ? this._zoom : e, this.options.crs.latLngToPoint(r.latLng(t), e)
          },
          unproject: function (t, e) {
            return e = e === n ? this._zoom : e, this.options.crs.pointToLatLng(r.point(t), e)
          },
          layerPointToLatLng: function (t) {
            var e = r.point(t).add(this.getPixelOrigin());
            return this.unproject(e)
          },
          latLngToLayerPoint: function (t) {
            var e = this.project(r.latLng(t));
            return this.options.optimized && (e = e._round()), e._subtract(this.getPixelOrigin())
          },
          latLngToPreciseLayerPoint: function (t) {
            var e = this.project(r.latLng(t));
            return e._subtract(this.getPixelOrigin())
          },
          containerPointToLayerPoint: function (t) {
            return r.point(t).subtract(this._getMapPanePos())
          },
          layerPointToContainerPoint: function (t) {
            return r.point(t).add(this._getMapPanePos())
          },
          containerPointToLatLng: function (t) {
            var e = this.containerPointToLayerPoint(r.point(t));
            return this.layerPointToLatLng(e)
          },
          latLngToContainerPoint: function (t) {
            return this.layerPointToContainerPoint(this.latLngToLayerPoint(r.latLng(t)))
          },
          latLngToPreciseContainerPoint: function (t) {
            return this.layerPointToContainerPoint(this.latLngToPreciseLayerPoint(r.latLng(t)))
          },
          mouseEventToContainerPoint: function (t) {
            return r.DomEvent.getMousePosition(t, this._container)
          },
          mouseEventToLayerPoint: function (t) {
            return this.containerPointToLayerPoint(this.mouseEventToContainerPoint(t))
          },
          mouseEventToLatLng: function (t) {
            return this.layerPointToLatLng(this.mouseEventToLayerPoint(t))
          },
          _initContainer: function (t) {
            var e = this._container = r.DomUtil.get(t);
            if (!e)throw new Error("Map container not found.");
            if (e._ngr)throw new Error("Map container is already initialized.");
            e._ngr = !0
          },
          _initLayout: function () {
            var t = this._container;
            r.DomUtil.addClass(t, "ngr-container" + (r.Browser.touch ? " ngr-touch" : "") + (r.Browser.retina ? " ngr-retina" : "") + (r.Browser.ielt9 ? " ngr-oldie" : "") + (this.options.fadeAnimation ? " ngr-fade-anim" : ""));
            var e = r.DomUtil.getStyle(t, "position");
            "absolute" !== e && "relative" !== e && "fixed" !== e && (t.style.position = "relative"), this._initPanes(), this._initControlPos && this._initControlPos()
          },
          _initPanes: function () {
            var t = this._panes = {};
            this._mapPane = t.mapPane = this._createPane("ngr-map-pane", this._container), this._tilePane = t.tilePane = this._createPane("ngr-tile-pane", this._mapPane), t.objectsPane = this._createPane("ngr-objects-pane", this._mapPane), t.shadowPane = this._createPane("ngr-shadow-pane"), t.overlayPane = this._createPane("ngr-overlay-pane"), t.markerPane = this._createPane("ngr-marker-pane"), t.popupPane = this._createPane("ngr-popup-pane");
            var e = " ngr-zoom-hide";
            this.options.markerZoomAnimation || (r.DomUtil.addClass(t.markerPane, e), r.DomUtil.addClass(t.shadowPane, e), r.DomUtil.addClass(t.popupPane, e))
          },
          _createPane: function (t, e) {
            return r.DomUtil.create("div", t, e || this._panes.objectsPane)
          },
          _clearPanes: function () {
            this._container.removeChild(this._mapPane)
          },
          _addLayers: function (t) {
            t = t ? r.Util.isArray(t) ? t : [t] : [];
            for (var e = 0, i = t.length; e < i; e++)this.addLayer(t[e])
          },
          _resetView: function (t, e, i, n) {
            var o = this._zoom !== e;
            n || (this.fire("movestart"), o && this.fire("zoomstart")), this._zoom = e, this._initialCenter = t, this._initialTopLeftPoint = this._getNewTopLeftPoint(t), i ? this._initialTopLeftPoint._add(this._getMapPanePos()) : r.DomUtil.setPosition(this._mapPane, new r.Point(0, 0)), this._tileLayersToLoad = this._tileLayersNum;
            var s = !this._loaded;
            this._loaded = !0, this.fire("viewreset", {hard: !i}), s && (this.fire("load"), this.eachLayer(this._layerAdd, this)), this.fire("move"), (o || n) && this.fire("zoomend"), this.fire("moveend", {hard: !i})
          },
          _rawPanBy: function (t) {
            r.DomUtil.setPosition(this._mapPane, this._getMapPanePos().subtract(t))
          },
          _getZoomSpan: function () {
            return this.getMaxZoom() - this.getMinZoom()
          },
          _updateZoomLevels: function () {
            var t, e = 1 / 0, i = -(1 / 0), o = this._getZoomSpan();
            for (t in this._zoomBoundLayers) {
              var r = this._zoomBoundLayers[t];
              isNaN(r.options.minZoom) || (e = Math.min(e, r.options.minZoom)), isNaN(r.options.maxZoom) || (i = Math.max(i, r.options.maxZoom))
            }
            t === n ? this._layersMaxZoom = this._layersMinZoom = n : (this._layersMaxZoom = i, this._layersMinZoom = e), o !== this._getZoomSpan() && this.fire("zoomlevelschange")
          },
          _panInsideMaxBounds: function () {
            this.panInsideBounds(this.options.maxBounds)
          },
          _checkIfLoaded: function () {
            if (!this._loaded)throw new Error("Set map center and zoom first.")
          },
          _initEvents: function (e) {
            // dom事件转为canvas事件的入口
            if (r.DomEvent) {
              e = e || "on", r.DomEvent[e](this._container, "click", this._onMouseClick, this);
              var i, n,
                o = ["dblclick", "mousedown", "mouseup", "mouseenter", "mouseleave", "mousemove", "contextmenu"];
              for (i = 0, n = o.length; i < n; i++)r.DomEvent[e](this._container, o[i], this._fireMouseEvent, this);
              this.options.trackResize && r.DomEvent[e](t, "resize", this._onResize, this)
            }
          },
          _onResize: function () {
            r.Util.cancelAnimFrame(this._resizeRequest), this._resizeRequest = r.Util.requestAnimFrame(function () {
              this.invalidateSize({debounceMoveend: !0})
            }, this, !1, this._container)
          },
          _onMouseClick: function (t) {
            !this._loaded || !t._simulated && (this.dragging && this.dragging.moved() || this.boxZoom && this.boxZoom.moved()) || r.DomEvent._skipped(t) || (this.fire("preclick"), this._fireMouseEvent(t))
          },
          _fireMouseEvent: function (t) {
            // dom事件转为canvas事件（mouse相关部分）
            if (this._loaded && !r.DomEvent._skipped(t)) {
              var e = t.type;
              if (e = "mouseenter" === e ? "mouseover" : "mouseleave" === e ? "mouseout" : e, this.hasEventListeners(e)) {
                "contextmenu" === e && r.DomEvent.preventDefault(t);
                var i = this.mouseEventToContainerPoint(t), n = this.containerPointToLayerPoint(i),
                  o = this.layerPointToLatLng(n);
                this.fire(e, {latlng: o, layerPoint: n, containerPoint: i, originalEvent: t})
              }
            }
          },
          _onTileLayerLoad: function () {
            this._tileLayersToLoad--, this._tileLayersNum && !this._tileLayersToLoad && this.fire("tilelayersload")
          },
          _clearHandlers: function () {
            for (var t = 0, e = this._handlers.length; t < e; t++)this._handlers[t].disable()
          },
          whenReady: function (t, e) {
            return this._loaded ? t.call(e || this, this) : this.on("load", t, e), this
          },
          _layerAdd: function (t) {
            // 新增图层(单个Layer和Group都被调用), this指代map对象
            // 所有图层均经过了这里
            t.onAdd(this)
            this.fire("layeradd", {layer: t})
          },
          _getMapPanePos: function () {
            return r.DomUtil.getPosition(this._mapPane)
          },
          _moved: function () {
            var t = this._getMapPanePos();
            return t && !t.equals([0, 0])
          },
          _getTopLeftPoint: function () {
            return this.getPixelOrigin().subtract(this._getMapPanePos())
          },
          _getNewTopLeftPoint: function (t, e) {
            var i = this.getSize()._divideBy(2);
            return this.project(t, e)._subtract(i)._round()
          },
          _latLngToNewLayerPoint: function (t, e, i) {
            var n = this._getNewTopLeftPoint(i, e).add(this._getMapPanePos());
            return this.project(t, e)._subtract(n)
          },
          _getCenterLayerPoint: function () {
            return this.containerPointToLayerPoint(this.getSize()._divideBy(2))
          },
          _getCenterOffset: function (t) {
            return this.latLngToLayerPoint(t).subtract(this._getCenterLayerPoint())
          },
          _limitCenter: function (t, e, i) {
            if (!i)return t;
            var n = this.project(t, e), o = this.getSize().divideBy(2), s = new r.Bounds(n.subtract(o), n.add(o)),
              a = this._getBoundsOffset(s, i, e);
            return this.unproject(n.add(a), e)
          },
          _limitOffset: function (t, e) {
            if (!e)return t;
            var i = this.getPixelBounds(), n = new r.Bounds(i.min.add(t), i.max.add(t));
            return t.add(this._getBoundsOffset(n, e))
          },
          _getBoundsOffset: function (t, e, i) {
            var n = this.project(e.getNorthWest(), i).subtract(t.min),
              o = this.project(e.getSouthEast(), i).subtract(t.max), s = this._rebound(n.x, -o.x),
              a = this._rebound(n.y, -o.y);
            return new r.Point(s, a)
          },
          _rebound: function (t, e) {
            return t + e > 0 ? Math.round(t - e) / 2 : Math.max(0, Math.ceil(t)) - Math.max(0, Math.floor(e))
          },
          _limitZoom: function (t) {
            var e = this.getMinZoom(), i = this.getMaxZoom();
            return Math.max(e, Math.min(i, t))
          }
        }), r.map = function (t, e) {
          return new r.Map(t, e)
        }, r.Projection.Mercator = {
          MAX_LATITUDE: 85.0840591556, R_MINOR: 6356752.314245179, R_MAJOR: 6378137, project: function (t) {
            var e = r.LatLng.DEG_TO_RAD, i = this.MAX_LATITUDE, n = Math.max(Math.min(i, t.lat), -i), o = this.R_MAJOR,
              s = this.R_MINOR, a = t.lng * e * o, h = n * e, l = s / o, u = Math.sqrt(1 - l * l), c = u * Math.sin(h);
            c = Math.pow((1 - c) / (1 + c), .5 * u);
            var p = Math.tan(.5 * (.5 * Math.PI - h)) / c;
            return h = -o * Math.log(p), new r.Point(a, h)
          }, unproject: function (t) {
            for (var e, i = r.LatLng.RAD_TO_DEG, n = this.R_MAJOR, o = this.R_MINOR, s = t.x * i / n, a = o / n,
                   h = Math.sqrt(1 - a * a), l = Math.exp(-t.y / n), u = Math.PI / 2 - 2 * Math.atan(l), c = 15,
                   p = 1e-7, d = c,
                   f = .1; Math.abs(f) > p && --d > 0;)e = h * Math.sin(u), f = Math.PI / 2 - 2 * Math.atan(l * Math.pow((1 - e) / (1 + e), .5 * h)) - u, u += f;
            return new r.LatLng(u * i, s)
          }
        }, r.CRS.EPSG3395 = r.extend({}, r.CRS, {
          code: "EPSG:3395",
          projection: r.Projection.Mercator,
          transformation: function () {
            var t = r.Projection.Mercator, e = t.R_MAJOR, i = .5 / (Math.PI * e);
            return new r.Transformation(i, .5, (-i), .5)
          }()
        }), r.TileLayer = r.Class.extend({
          includes: r.Mixin.Events,
          options: {
            minZoom: 0,
            maxZoom: 18,
            tileSize: 256,
            subdomains: "abc",
            errorTileUrl: "",
            attribution: "",
            zoomOffset: 0,
            opacity: 1,
            unloadInvisibleTiles: r.Browser.mobile,
            updateWhenIdle: r.Browser.mobile
          },
          initialize: function (t, e) {
            e = r.setOptions(this, e), e.detectRetina && r.Browser.retina && e.maxZoom > 0 && (e.tileSize = Math.floor(e.tileSize / 2), e.zoomOffset++, e.minZoom > 0 && e.minZoom--, this.options.maxZoom--), e.bounds && (e.bounds = r.latLngBounds(e.bounds)), this._url = t;
            var i = this.options.subdomains;
            "string" == typeof i && (this.options.subdomains = i.split(""))
          },
          onAdd: function (t) {
            // 不是
            this._map = t, this._animated = t._zoomAnimated, this._initContainer(), t.on({
              viewreset: this._reset,
              moveend: this._update
            }, this), this._animated && t.on({
              zoomanim: this._animateZoom,
              zoomend: this._endZoomAnim
            }, this), this.options.updateWhenIdle || (this._limitedUpdate = r.Util.limitExecByInterval(this._update, 150, this), t.on("move", this._limitedUpdate, this)), this._reset(), this._update()
          },
          addTo: function (t) {
            return t.addLayer(this), this
          },
          onRemove: function (t) {
            this._container.parentNode.removeChild(this._container), t.off({
              viewreset: this._reset,
              moveend: this._update
            }, this), this._animated && t.off({
              zoomanim: this._animateZoom,
              zoomend: this._endZoomAnim
            }, this), this.options.updateWhenIdle || t.off("move", this._limitedUpdate, this), this._container = null, this._map = null
          },
          bringToFront: function () {
            var t = this._map._panes.tilePane;
            return this._container && (t.appendChild(this._container), this._setAutoZIndex(t, Math.max)), this
          },
          bringToBack: function () {
            var t = this._map._panes.tilePane;
            return this._container && (t.insertBefore(this._container, t.firstChild), this._setAutoZIndex(t, Math.min)), this
          },
          getAttribution: function () {
            return this.options.attribution
          },
          getContainer: function () {
            return this._container
          },
          setOpacity: function (t) {
            return this.options.opacity = t, this._map && this._updateOpacity(), this
          },
          setZIndex: function (t) {
            return this.options.zIndex = t, this._updateZIndex(), this
          },
          setUrl: function (t, e) {
            return this._url = t, e || this.redraw(), this
          },
          redraw: function () {
            return this._map && (this._reset({hard: !0}), this._update()), this
          },
          _updateZIndex: function () {
            this._container && this.options.zIndex !== n && (this._container.style.zIndex = this.options.zIndex)
          },
          _setAutoZIndex: function (t, e) {
            var i, n, o, r = t.children, s = -e(1 / 0, -(1 / 0));
            for (n = 0, o = r.length; n < o; n++)r[n] !== this._container && (i = parseInt(r[n].style.zIndex, 10), isNaN(i) || (s = e(s, i)));
            this.options.zIndex = this._container.style.zIndex = (isFinite(s) ? s : 0) + e(1, -1)
          },
          _updateOpacity: function () {
            var t, e = this._tiles;
            if (r.Browser.ielt9)for (t in e)r.DomUtil.setOpacity(e[t], this.options.opacity); else r.DomUtil.setOpacity(this._container, this.options.opacity)
          },
          _initContainer: function () {
            var t = this._map._panes.tilePane;
            if (!this._container) {
              if (this._container = r.DomUtil.create("div", "ngr-layer"), this._updateZIndex(), this._animated) {
                var e = "ngr-tile-container";
                this._bgBuffer = r.DomUtil.create("div", e, this._container), this._tileContainer = r.DomUtil.create("div", e, this._container)
              } else this._tileContainer = this._container;
              t.appendChild(this._container), this.options.opacity < 1 && this._updateOpacity()
            }
          },
          _reset: function (t) {
            for (var e in this._tiles)this.fire("tileunload", {tile: this._tiles[e]});
            this._tiles = {}, this._tilesToLoad = 0, this.options.reuseTiles && (this._unusedTiles = []), this._tileContainer.innerHTML = "", this._animated && t && t.hard && this._clearBgBuffer(), this._initContainer()
          },
          _getTileSize: function () {
            var t = this._map, e = t.getZoom() + this.options.zoomOffset, i = this.options.maxNativeZoom,
              n = this.options.tileSize;
            return i && e > i && (n = Math.round(t.getZoomScale(e) / t.getZoomScale(i) * n)), n
          },
          _update: function () {
            if (this._map) {
              var t = this._map, e = t.getPixelBounds(), i = t.getZoom(), n = this._getTileSize();
              if (!(i > this.options.maxZoom || i < this.options.minZoom)) {
                var o = r.bounds(e.min.divideBy(n)._floor(), e.max.divideBy(n)._floor());
                this._addTilesFromCenterOut(o), (this.options.unloadInvisibleTiles || this.options.reuseTiles) && this._removeOtherTiles(o)
              }
            }
          },
          _addTilesFromCenterOut: function (t) {
            var e, n, o, s = [], a = t.getCenter();
            for (e = t.min.y; e <= t.max.y; e++)for (n = t.min.x; n <= t.max.x; n++)o = new r.Point(n, e), this._tileShouldBeLoaded(o) && s.push(o);
            var h = s.length;
            if (0 !== h) {
              s.sort(function (t, e) {
                return t.distanceTo(a) - e.distanceTo(a)
              });
              var l = i.createDocumentFragment();
              for (this._tilesToLoad || this.fire("loading"), this._tilesToLoad += h, n = 0; n < h; n++)this._addTile(s[n], l);
              this._tileContainer.appendChild(l)
            }
          },
          _tileShouldBeLoaded: function (t) {
            if (t.x + ":" + t.y in this._tiles)return !1;
            var e = this.options;
            if (!e.continuousWorld) {
              var i = this._getWrapTileNum();
              if (e.noWrap && (t.x < 0 || t.x >= i.x) || t.y < 0 || t.y >= i.y)return !1
            }
            if (e.bounds) {
              var n = e.tileSize, o = t.multiplyBy(n), r = o.add([n, n]), s = this._map.unproject(o),
                a = this._map.unproject(r);
              if (e.continuousWorld || e.noWrap || (s = s.wrap(), a = a.wrap()), !e.bounds.intersects([s, a]))return !1
            }
            return !0
          },
          _removeOtherTiles: function (t) {
            var e, i, n, o;
            for (o in this._tiles)e = o.split(":"), i = parseInt(e[0], 10), n = parseInt(e[1], 10), (i < t.min.x || i > t.max.x || n < t.min.y || n > t.max.y) && this._removeTile(o)
          },
          _removeTile: function (t) {
            var e = this._tiles[t];
            this.fire("tileunload", {
              tile: e,
              url: e.src
            }), this.options.reuseTiles ? (r.DomUtil.removeClass(e, "ngr-tile-loaded"), this._unusedTiles.push(e)) : e.parentNode === this._tileContainer && this._tileContainer.removeChild(e), r.Browser.android || (e.onload = null, e.src = r.Util.emptyImageUrl), delete this._tiles[t]
          },
          _addTile: function (t, e) {
            var i = this._getTilePos(t), n = this._getTile();
            r.DomUtil.setPosition(n, i, r.Browser.chrome), this._tiles[t.x + ":" + t.y] = n, this._loadTile(n, t), n.parentNode !== this._tileContainer && e.appendChild(n)
          },
          _getZoomForUrl: function () {
            var t = this.options, e = this._map.getZoom();
            return t.zoomReverse && (e = t.maxZoom - e), e += t.zoomOffset, t.maxNativeZoom ? Math.min(e, t.maxNativeZoom) : e
          },
          _getTilePos: function (t) {
            var e = this._map.getPixelOrigin(), i = this._getTileSize();
            return t.multiplyBy(i).subtract(e)
          },
          getTileUrl: function (t) {
            return r.Util.template(this._url, r.extend({
              s: this._getSubdomain(t),
              z: t.z,
              x: t.x,
              y: t.y
            }, this.options))
          },
          _getWrapTileNum: function () {
            var t = this._map.options.crs, e = t.getSize(this._map.getZoom());
            return e.divideBy(this._getTileSize())._floor()
          },
          _adjustTilePoint: function (t) {
            var e = this._getWrapTileNum();
            this.options.continuousWorld || this.options.noWrap || (t.x = (t.x % e.x + e.x) % e.x), this.options.tms && (t.y = e.y - t.y - 1), t.z = this._getZoomForUrl()
          },
          _getSubdomain: function (t) {
            var e = Math.abs(t.x + t.y) % this.options.subdomains.length;
            return this.options.subdomains[e]
          },
          _getTile: function () {
            if (this.options.reuseTiles && this._unusedTiles.length > 0) {
              var t = this._unusedTiles.pop();
              return this._resetTile(t), t
            }
            return this._createTile()
          },
          _resetTile: function () {
          },
          _createTile: function () {
            var t = r.DomUtil.create("img", "ngr-tile");
            return t.style.width = t.style.height = this._getTileSize() + "px", t.galleryimg = "no", t.onselectstart = t.onmousemove = r.Util.falseFn, r.Browser.ielt9 && this.options.opacity !== n && r.DomUtil.setOpacity(t, this.options.opacity), r.Browser.mobileWebkit3d && (t.style.WebkitBackfaceVisibility = "hidden"), t
          },
          _loadTile: function (t, e) {
            t._layer = this, t.onload = this._tileOnLoad, t.onerror = this._tileOnError, this._adjustTilePoint(e), t.src = this.getTileUrl(e), this.fire("tileloadstart", {
              tile: t,
              url: t.src
            })
          },
          _tileLoaded: function () {
            this._tilesToLoad--, this._animated && r.DomUtil.addClass(this._tileContainer, "ngr-zoom-animated"), this._tilesToLoad || (this.fire("load"), this._animated && (clearTimeout(this._clearBgBufferTimer), this._clearBgBufferTimer = setTimeout(r.bind(this._clearBgBuffer, this), 500)))
          },
          _tileOnLoad: function () {
            var t = this._layer;
            this.src !== r.Util.emptyImageUrl && (r.DomUtil.addClass(this, "ngr-tile-loaded"), t.fire("tileload", {
              tile: this,
              url: this.src
            })), t._tileLoaded()
          },
          _tileOnError: function () {
            var t = this._layer;
            t.fire("tileerror", {tile: this, url: this.src});
            var e = t.options.errorTileUrl;
            e && (this.src = e), t._tileLoaded()
          }
        }), r.tileLayer = function (t, e) {
          return new r.TileLayer(t, e)
        }, r.TileLayer.WMS = r.TileLayer.extend({
          defaultWmsParams: {
            service: "WMS",
            request: "GetMap",
            version: "1.1.1",
            layers: "",
            styles: "",
            format: "image/jpeg",
            transparent: !1
          }, initialize: function (t, e) {
            this._url = t;
            var i = r.extend({}, this.defaultWmsParams), n = e.tileSize || this.options.tileSize;
            e.detectRetina && r.Browser.retina ? i.width = i.height = 2 * n : i.width = i.height = n;
            for (var o in e)this.options.hasOwnProperty(o) || "crs" === o || (i[o] = e[o]);
            this.wmsParams = i, r.setOptions(this, e)
          }, onAdd: function (t) {
            this._crs = this.options.crs || t.options.crs, this._wmsVersion = parseFloat(this.wmsParams.version);
            var e = this._wmsVersion >= 1.3 ? "crs" : "srs";
            // 不是
            this.wmsParams[e] = this._crs.code, r.TileLayer.prototype.onAdd.call(this, t)
          }, getTileUrl: function (t) {
            var e = this._map, i = this.options.tileSize, n = t.multiplyBy(i), o = n.add([i, i]),
              s = this._crs.project(e.unproject(n, t.z)), a = this._crs.project(e.unproject(o, t.z)),
              h = this._wmsVersion >= 1.3 && this._crs === r.CRS.EPSG4326 ? [a.y, s.x, s.y, a.x].join(",") : [s.x, a.y, a.x, s.y].join(","),
              l = r.Util.template(this._url, {s: this._getSubdomain(t)});
            return l + r.Util.getParamString(this.wmsParams, l, !0) + "&BBOX=" + h
          }, setParams: function (t, e) {
            return r.extend(this.wmsParams, t), e || this.redraw(), this
          }
        }), r.tileLayer.wms = function (t, e) {
          return new r.TileLayer.WMS(t, e)
        }, r.TileLayer.Canvas = r.TileLayer.extend({
          options: {async: !1}, initialize: function (t) {
            r.setOptions(this, t)
          }, redraw: function () {
            this._map && (this._reset({hard: !0}), this._update());
            for (var t in this._tiles)this._redrawTile(this._tiles[t]);
            return this
          }, _redrawTile: function (t) {
            this.drawTile(t, t._tilePoint, this._map._zoom)
          }, _createTile: function () {

            var t = r.DomUtil.create("canvas", "ngr-tile");
            return t.width = t.height = this.options.tileSize, t.onselectstart = t.onmousemove = r.Util.falseFn, t
          }, _loadTile: function (t, e) {
            t._layer = this, t._tilePoint = e, this._redrawTile(t), this.options.async || this.tileDrawn(t)
          }, drawTile: function () {
          }, tileDrawn: function (t) {
            this._tileOnLoad.call(t)
          }
        }), r.tileLayer.canvas = function (t) {
          return new r.TileLayer.Canvas(t)
        }, r.ImageOverlay = r.Class.extend({
          includes: r.Mixin.Events,
          options: {opacity: 1},
          initialize: function (t, e, i) {
            this._url = t, this._bounds = r.latLngBounds(e), r.setOptions(this, i)
          },
          onAdd: function (t) {
// 不是
            this._map = t, this._image || this._initImage(), t._panes.overlayPane.appendChild(this._image), t.on("viewreset", this._reset, this), t.options.zoomAnimation && r.Browser.any3d && t.on("zoomanim", this._animateZoom, this), this._reset()
          },
          onRemove: function (t) {
            t.getPanes().overlayPane.removeChild(this._image), t.off("viewreset", this._reset, this), t.options.zoomAnimation && t.off("zoomanim", this._animateZoom, this)
          },
          addTo: function (t) {
            return t.addLayer(this), this
          },
          setOpacity: function (t) {
            return this.options.opacity = t, this._updateOpacity(), this
          },
          bringToFront: function () {
            return this._image && this._map._panes.overlayPane.appendChild(this._image), this
          },
          bringToBack: function () {
            var t = this._map._panes.overlayPane;
            return this._image && t.insertBefore(this._image, t.firstChild), this
          },
          setUrl: function (t) {
            this._url = t, this._image.src = this._url
          },
          getAttribution: function () {
            return this.options.attribution
          },
          _initImage: function () {
            this._image = r.DomUtil.create("img", "ngr-image-layer"), this._map.options.zoomAnimation && r.Browser.any3d ? r.DomUtil.addClass(this._image, "ngr-zoom-animated") : r.DomUtil.addClass(this._image, "ngr-zoom-hide"), this._updateOpacity(), r.extend(this._image, {
              galleryimg: "no",
              onselectstart: r.Util.falseFn,
              onmousemove: r.Util.falseFn,
              onload: r.bind(this._onImageLoad, this),
              src: this._url
            })
          },
          _animateZoom: function (t) {
            var e = this._map, i = this._image, n = e.getZoomScale(t.zoom), o = this._bounds.getNorthWest(),
              s = this._bounds.getSouthEast(), a = e._latLngToNewLayerPoint(o, t.zoom, t.center),
              h = e._latLngToNewLayerPoint(s, t.zoom, t.center)._subtract(a),
              l = a._add(h._multiplyBy(.5 * (1 - 1 / n)));
            i.style[r.DomUtil.TRANSFORM] = r.DomUtil.getTranslateString(l) + " scale(" + n + ") "
          },
          _reset: function () {
            var t = this._image, e = this._map.latLngToLayerPoint(this._bounds.getNorthWest()),
              i = this._map.latLngToLayerPoint(this._bounds.getSouthEast())._subtract(e);
            r.DomUtil.setPosition(t, e), t.style.width = i.x + "px", t.style.height = i.y + "px"
          },
          _onImageLoad: function () {
            this.fire("load")
          },
          _updateOpacity: function () {
            r.DomUtil.setOpacity(this._image, this.options.opacity)
          }
        }), r.imageOverlay = function (t, e, i) {
          return new r.ImageOverlay(t, e, i)
        }, r.Icon = r.Class.extend({
          options: {className: "", hideWhenError: !0}, initialize: function (t) {
            r.setOptions(this, t)
          }, createIcon: function (t) {
            return this._createIcon("icon", t)
          }, createShadow: function (t) {
            return this._createIcon("shadow", t)
          }, _createIcon: function (t, e) {
            var i = this._getIconUrl(t);
            if (!i) {
              if ("icon" === t)throw new Error("iconUrl not set in Icon options (see the docs).");
              return null
            }
            var n;
            return n = e && "IMG" === e.tagName ? this._createImg(i, e) : this._createImg(i), this.options.hideWhenError && n.addEventListener("error", function (t) {
              return function () {
                t.style.display = "none"
              }
            }(n), !1), this._setIconStyles(n, t), n
          }, _setIconStyles: function (t, e) {
            var i = this.options, n = this._getIconSize(e), o = this._getIconAnchor(e);
            t.className = "ngr-marker-" + e + " " + i.className, o && (t.style.marginLeft = -o.x + "px", t.style.marginTop = -o.y + "px"), n && (t.style.width = n.x + "px", t.style.height = n.y + "px")
          }, _createImg: function (t, e) {
            return e = e || i.createElement("img"), e.src = t, e
          }, _getIconUrl: function (t) {
            return r.Browser.retina && this.options[t + "RetinaUrl"] ? this.options[t + "RetinaUrl"] : this.options[t + "Url"]
          }, _getIconAnchor: function (t) {
            var e, i = this.options, n = this._getIconSize(t);
            return e = "shadow" === t ? r.point(i.shadowAnchor || i.iconAnchor) : r.point(i.iconAnchor), !e && n && (e = n.divideBy(2, !0)), e
          }, _getIconSize: function (t) {
            var e = r.point(this.options[t + "Size"]);
            if (!e || e && e.x && e.x > 0 && e.y && e.y > 0)return e;
            throw new Error("Invalid Icon Size")
          }
        }), r.icon = function (t) {
          return new r.Icon(t)
        }, r.Icon.Default = r.Icon.extend({
          options: {
            iconSize: [25, 41],
            iconAnchor: [12, 41],
            popupAnchor: [1, -34],
            shadowSize: [41, 41]
          }, _getIconUrl: function (t) {
            var e = t + "Url";
            if (this.options[e])return this.options[e];
            r.Browser.retina && "icon" === t && (t += "-2x");
            var i = r.Icon.Default.imagePath;
            if (!i)throw new Error("Couldn't autodetect L.Icon.Default.imagePath, set it manually.");
            return i + "/marker-" + t + ".png"
          }
        }), r.Icon.Default.imagePath = function () {
          var t, e, n, o, r, s = i.getElementsByTagName("script"),
            a = /[\/^](PalmapSDK|ngr)[\-\._]?([\w\-\._]*)\.js\??/i;
          for (t = 0, e = s.length; t < e; t++)if (n = s[t].src, o = n.match(a))return r = n.split(a)[0].split("libs")[0], (r ? r + "/resources/" : "") + "images"
        }(), r.Icon.Location = r.Icon.extend({
          options: {iconSize: [20, 20], showHalo: !0},
          _getIconUrl: function (t) {
            var e = t + "Url";
            if (this.options[e])return this.options[e];
            var i = r.Icon.Default.imagePath;
            if (!i)throw new Error("Couldn't autodetect NGR.Icon.Default.imagePath, set it manually.");
            return "icon" == t ? i + "/marker-location.png" : void 0
          },
          _setIconStyles: function (t, e) {
            var i = this.options, n = this._getIconSize(e), o = this._getIconAnchor(e);
            t.className = "ngr-marker-" + e + " ngr-trackBall " + i.className + (i.showHalo ? " ngr-halo" : ""), this.setActiveStatus = function (e) {
              var i = t.className.split(" "), n = i.indexOf("ngr-gray");
              n < 0 ^ e && (e ? i.splice(n, 1) : i.push("ngr-gray")), t.className = i.join(" ")
            }, o && (t.style.marginLeft = -o.x + "px", t.style.marginTop = -o.y + "px"), n && (t.style.width = n.x + "px", t.style.height = n.y + "px")
          }
        }), r.icon.location = function (t) {
          return new r.Icon.Location(t)
        }, r.Marker = r.Class.extend({
          includes: r.Mixin.Events,
          options: {
            icon: new r.Icon.Default,
            title: "",
            alt: "",
            clickable: !0,
            draggable: !1,
            keyboard: !0,
            zIndexOffset: 0,
            opacity: 1,
            riseOnHover: !1,
            riseOffset: 250
          },
          initialize: function (t, e) {
            r.setOptions(this, e), this._latlng = r.latLng(t)
          },
          onAdd: function (t) {
            // 不是
            this._map = t, t.on("viewreset", this.update, this), this._initIcon(), this.update(), this.fire("add"), t.options.zoomAnimation && t.options.markerZoomAnimation && t.on("zoomanim", this._animateZoom, this)
          },
          addTo: function (t) {
            return t.addLayer(this), this
          },
          onRemove: function (t) {
            this.dragging && this.dragging.disable(), this._removeIcon(), this._removeShadow(), this.fire("remove"), t.off({
              viewreset: this.update,
              zoomanim: this._animateZoom
            }, this), this._map = null
          },
          getLatLng: function () {
            return this._latlng
          },
          setLatLng: function (t) {
            return this._latlng = r.latLng(t), this.update(), this.fire("move", {latlng: this._latlng})
          },
          setZIndexOffset: function (t) {
            return this.options.zIndexOffset = t, this.update(), this
          },
          setIcon: function (t) {
            return this.options.icon = t, this._map && (this._initIcon(), this.update()), this._popup && this.bindPopup(this._popup), this
          },
          update: function () {
            if (this._icon) {
              var t = this._map.latLngToLayerPoint(this._latlng).round();
              this._setPos(t)
            }
            return this
          },
          _initIcon: function () {
            var t = this.options, e = this._map, i = e.options.zoomAnimation && e.options.markerZoomAnimation,
              n = i ? "ngr-zoom-animated" : "ngr-zoom-hide";
            if (!(t.icon instanceof r.Icon))throw new Error("Invalid Icon");
            var o = t.icon.createIcon(this._icon), s = !1;
            o !== this._icon && (this._icon && this._removeIcon(), s = !0, t.title && (o.title = t.title), t.alt && (o.alt = t.alt)), r.DomUtil.addClass(o, n), t.keyboard && (o.tabIndex = "0"), this._icon = o, this._initInteraction(), t.riseOnHover && r.DomEvent.on(o, "mouseover", this._bringToFront, this).on(o, "mouseout", this._resetZIndex, this);
            var a = t.icon.createShadow(this._shadow), h = !1;
            a !== this._shadow && (this._removeShadow(), h = !0), a && r.DomUtil.addClass(a, n), this._shadow = a, t.opacity < 1 && this._updateOpacity();
            var l = this._map._panes;
            s && l.markerPane.appendChild(this._icon), a && h && l.shadowPane.appendChild(this._shadow)
          },
          _removeIcon: function () {
            this.options.riseOnHover && r.DomEvent.off(this._icon, "mouseover", this._bringToFront).off(this._icon, "mouseout", this._resetZIndex), this._map._panes.markerPane.removeChild(this._icon), this._icon = null
          },
          _removeShadow: function () {
            this._shadow && this._map._panes.shadowPane.removeChild(this._shadow), this._shadow = null
          },
          _setPos: function (t) {
            r.DomUtil.setPosition(this._icon, t), this._shadow && r.DomUtil.setPosition(this._shadow, t), this._zIndex = t.y + this.options.zIndexOffset, this._resetZIndex()
          },
          _updateZIndex: function (t) {
            this._icon.style.zIndex = this._zIndex + t
          },
          _animateZoom: function (t) {
            var e = this._map._latLngToNewLayerPoint(this._latlng, t.zoom, t.center).round();
            this._setPos(e)
          },
          _initInteraction: function () {
            if (this.options.clickable) {
              var t = this._icon, e = ["dblclick", "mousedown", "mouseover", "mouseout", "contextmenu"];
              r.DomUtil.addClass(t, "ngr-clickable"), r.DomEvent.on(t, "click", this._onMouseClick, this), r.DomEvent.on(t, "keypress", this._onKeyPress, this);
              for (var i = 0; i < e.length; i++)r.DomEvent.on(t, e[i], this._fireMouseEvent, this);
              r.Handler.MarkerDrag && (this.dragging = new r.Handler.MarkerDrag(this), this.options.draggable && this.dragging.enable())
            }
          },
          _onMouseClick: function (t) {
            var e = this.dragging && this.dragging.moved();
            (this.hasEventListeners(t.type) || e) && r.DomEvent.stopPropagation(t), e || (this.dragging && this.dragging._enabled || !this._map.dragging || !this._map.dragging.moved()) && this.fire(t.type, {
              originalEvent: t,
              latlng: this._latlng
            })
          },
          _onKeyPress: function (t) {
            13 === t.keyCode && this.fire("click", {originalEvent: t, latlng: this._latlng})
          },
          _fireMouseEvent: function (t) {
            this.fire(t.type, {
              originalEvent: t,
              latlng: this._latlng
            }), "contextmenu" === t.type && this.hasEventListeners(t.type) && r.DomEvent.preventDefault(t), "mousedown" !== t.type ? r.DomEvent.stopPropagation(t) : r.DomEvent.preventDefault(t)
          },
          setOpacity: function (t) {
            return this.options.opacity = t, this._map && this._updateOpacity(), this
          },
          _updateOpacity: function () {
            r.DomUtil.setOpacity(this._icon, this.options.opacity), this._shadow && r.DomUtil.setOpacity(this._shadow, this.options.opacity)
          },
          _bringToFront: function () {
            this._updateZIndex(this.options.riseOffset)
          },
          _resetZIndex: function () {
            this._updateZIndex(0)
          }
        }), r.marker = function (t, e) {
          return new r.Marker(t, e)
        }, r.RotatedMarker = r.Marker.extend({
          options: {angle: 0, indicateDirection: !1},
          initialize: function (t, e) {
            r.Marker.prototype.initialize.call(this, t, e);
            var i = this;
            this.deviceorientationHandler = function (t) {
              i.options.angle = t.webkitCompassHeading || (t.alpha < 0 ? -t.alpha : 360 - t.alpha), i.update()
            }
          },
          onAdd: function (e) {
            // 不是
            r.Marker.prototype.onAdd.call(this, e), t.addEventListener("deviceorientation", this.deviceorientationHandler, !1)
          },
          onRemove: function (e) {
            r.Marker.prototype.onRemove.call(this, e), t.removeEventListener("deviceorientation", this.deviceorientationHandler, !1)
          },
          _setPos: function (t) {
            if (r.Marker.prototype._setPos.call(this, t), r.DomUtil.TRANSFORM) this._icon.style[r.DomUtil.TRANSFORM] += " rotate(" + this.options.angle + "deg)"; else if (r.Browser.ie) {
              var e = this.options.angle * r.LatLng.DEG_TO_RAD, i = Math.cos(e), n = Math.sin(e);
              this._icon.style.filter += " progid:DXImageTransform.Microsoft.Matrix(sizingMethod='auto expand', M11=" + i + ", M12=" + -n + ", M21=" + n + ", M22=" + i + ")"
            }
          }
        }), r.rotatedMarker = function (t, e) {
          return new r.RotatedMarker(t, e)
        }, r.CanvasMarker = r.Class.extend(t.NGR_PREFER_CANVAS ? {
          includes: [r.Mixin.Events],
          statics: {_imgCache: {}},
          options: {icon: new r.Icon.Default, clickable: !1, opacity: 1, rotate: 0, fixedSize: !1},
          initialize: function (t, e) {
            return r.Browser.canvas ? (r.setOptions(this, e), this.latlng = r.latLng(t), this.moveSwitch = 1, this.lastLatlng = [], void(this.options.icon && this._loadImage())) : void console.warn("Your browser doesn't support canvas.")
          },
          onAdd: function (t) {
            //不是
            this._map = t, this._ctx = t._canvasCtx, t._pathRoot || t._initPathRoot(), this._initialized || (this._initEvents(), this._initialized = !0), this.options.fixedSize && this._parseSize(), this.fire("add"), t.on({
              viewreset: this.projectLatLngs,
              moveend: this._updateImage
            }, this), this.redraw()
          },
          onRemove: function (t) {
            t.off("viewreset", this.projectLatLngs, this).off("moveend", this._updateImage, this), this._requestUpdate(), this.fire("remove"), this._unloadEvents(), this._map = null
          },
          addTo: function (t) {
            return t.addLayer(this), this
          },
          projectLatLngs: function () {
            var t, e = this._map.latLngToLayerPoint(this.latlng);
            this._iconLatLngBounds ? (t = this._map.latLngToLayerPoint(this._iconLatLngBounds.getSouthEast()), this._leftTopPoint = this._map.latLngToLayerPoint(this._iconLatLngBounds.getNorthWest()), this._iconSize = t.subtract(this._leftTopPoint), this._imageBounds = r.bounds(this._leftTopPoint, t)) : this._iconImg && (this._leftTopPoint = e.subtract(this.options.icon._getIconAnchor("icon")), this._iconSize = r.point(this.options.icon.options.iconSize), this._imageBounds = r.bounds(this._leftTopPoint, this._leftTopPoint.add(this._iconSize))), this._shadowLatLngBounds ? (t = this._map.latLngToLayerPoint(this._shadowLatLngBounds.getSouthEast()), this._leftTopShadowPoint = this._map.latLngToLayerPoint(this._shadowLatLngBounds.getNorthWest()), this._shadowSize = t.subtract(this._leftTopShadowPoint)) : this._shadowImg && (this._leftTopShadowPoint = e.subtract(this.options.icon._getIconAnchor("shadow")), this._shadowSize = r.point(this.options.icon.options.shadowSize))
          },
          redraw: function () {
            return this._map && (this.projectLatLngs(), this._requestUpdate()), this
          },
          getLatLng: function () {
            return this.latlng
          },
          setLatLng: function (t) {
            return this.latlng = r.latLng(t), this._parseSize(), this.redraw(), this
          },
          animateMove: function (e) {
            function i(t) {
              return 1e12 * t
            }

            function n(t) {
              return t / 1e12
            }

            if (1 === this.moveSwitch)if (this.lastLatlng.length > 0) {
              this.moveSwitch = 0;
              var o = 0, r = [], s = [];
              r[0] = i(this.lastLatlng[0]), r[1] = i(this.lastLatlng[1]), s[0] = i(e[0]), s[1] = i(e[1]), moveLatStep = (s[0] - r[0]) / 200, moveLngStep = (s[1] - r[1]) / 200, _this = this, this.lastLatlng[0] = e[0], this.lastLatlng[1] = e[1];
              var a = t.setInterval(function () {
                o > 200 ? (clearInterval(a), _this.moveSwitch = 1) : (r[0] += moveLatStep, r[1] += moveLngStep, _this.setLatLng([n(r[0]), n(r[1])]), o++)
              }, 10)
            } else this.setLatLng(e), this.lastLatlng[0] = e[0], this.lastLatlng[1] = e[1]
          },
          setFixedSize: function (t) {
            return this.options.fixedSize = t, t ? this._parseSize() : (this._iconLatLngBounds = null, this._shadowLatLngBounds = null), this.redraw(), this
          },
          setStyle: function (t) {
            return r.setOptions(this, t), this._map && (this._loadImage(), this.setFixedSize(this.options.fixedSize), this.projectLatLngs(), this._requestUpdate()), this
          },
          _initEvents: function () {
            // 不是
            this.options.clickable && this._map.on("click", this._onClick, this)
          },
          _unloadEvents: function () {
            this.options.clickable && this._map.off("click", this._onClick, this)
          },
          _loadImage: function () {
            if (!(this.options.icon instanceof r.Icon))throw new Error("Invalid Icon");
            var t = this.options.icon._getIconUrl("icon"), e = this.options.icon._getIconUrl("shadow");
            t in r.CanvasMarker._imgCache ? this._iconImg = r.CanvasMarker._imgCache[t] : t && (this._loadingIcon = !0, this._iconImg = new Image, this._iconImg.addEventListener("load", function (e) {
                return function () {
                  e._loadingIcon = !1, r.CanvasMarker._imgCache[t] = e._iconImg, e._map && !e._loadingShadow && e.redraw()
                }
              }(this), !1), this._iconImg.addEventListener("error", function (e) {
                return function () {
                  e._loadingIcon = !1, r.CanvasMarker._imgCache[t] = null, e._iconImg = null
                }
              }(this), !1), this._iconImg.src = t), e in r.CanvasMarker._imgCache ? this._shadowImg = r.CanvasMarker._imgCache[e] : e && (this._loadingShadow = !0, this._shadowImg = new Image, this._shadowImg.addEventListener("load", function (t) {
                return function () {
                  t._loadingShadow = !1, r.CanvasMarker._imgCache[e] = t._shadowImg, t._map && !t._loadingIcon && t.redraw()
                }
              }(this), !1), this._shadowImg.addEventListener("error", function (e) {
                return function () {
                  e._loadingShadow = !1, r.CanvasMarker._imgCache[t] = null, e._shadowImg = null
                }
              }(this), !1), this._shadowImg.src = e)
          },
          _onClick: function (t) {
            this._containsPoint(t.layerPoint) && this.fire("click", t)
          },
          _updateImage: function () {
            if (this._ctx.save(), this._ctx.globalAlpha = this.options.opacity, this.options.rotate) {
              var t = this._imageBounds.getCenter();
              this._ctx.translate(t.x, t.y), this._ctx.rotate(this.options.rotate), this._ctx.translate(-t.x, -t.y)
            }
            this._shadowImg && this._ctx.drawImage(this._shadowImg, this._leftTopShadowPoint.x, this._leftTopShadowPoint.y, this._shadowSize.x, this._shadowSize.y), this._iconImg && this._ctx.drawImage(this._iconImg, this._leftTopPoint.x, this._leftTopPoint.y, this._iconSize.x, this._iconSize.y), this._ctx.restore()
          },
          _containsPoint: function (t) {
            return this._imageBounds.contains(t)
          },
          _requestUpdate: function () {
            this._map && !r.CanvasMarker._updateRequest && (r.CanvasMarker._updateRequest = r.Util.requestAnimFrame(this._fireMapMoveEnd, this._map))
          },
          _fireMapMoveEnd: function () {
            r.CanvasMarker._updateRequest = null, this.fire("moveend")
          },
          _parseSize: function () {
            if (this.options.fixedSize) {
              var t = this, e = function (t) {
                var e = /^(\d+|\d*\.\d+)\s*(m|px)?$/i.exec(t);
                if (e && 3 === e.length)return {value: parseFloat(e[1]), unit: e[2] ? e[2] : "px"};
                throw new Error('Wrong syntax "' + t + '" in fixedSize.')
              }, i = function (e, i, n, o) {
                var s, a, h, l, u = e.x / i.x * n.value, c = e.y / i.y * o.value;
                switch (n.unit + " " + o.unit) {
                  case"m m":
                    s = r.CRS.EPSG3857.project(t.latlng), a = s.subtract([u, c]), h = a.add([n.value, o.value]), l = r.latLngBounds(r.CRS.EPSG3857.unproject(a), r.CRS.EPSG3857.unproject(h));
                    break;
                  case"px px":
                    s = t._map.latLngToLayerPoint(t.latlng), a = s.subtract([u, c]), h = a.add([n.value, o.value]), l = r.latLngBounds(t._map.layerPointToLatLng(a), t._map.layerPointToLatLng(h));
                    break;
                  default:
                    console.warn("Unsupported unit combination", n.unit + "+" + o.unit)
                }
                return l
              }, n = function (n) {
                if (n in t.options.fixedSize) {
                  if (!(t.options.fixedSize[n] instanceof Array) || 2 != t.options.fixedSize[n].length)throw new Error("Wrong syntax in fixedSize.");
                  var o = t.options.icon._getIconSize(n), r = t.options.icon._getIconAnchor(n),
                    s = e(t.options.fixedSize[n][0]), a = e(t.options.fixedSize[n][1]);
                  return i(r, o, s, a)
                }
              };
              this._iconImg && "icon" in this.options.fixedSize && (this._iconLatLngBounds = n("icon")), this._shadowImg && "shadow" in this.options.fixedSize && (this._shadowLatLngBounds = n("shadow"))
            }
          }
        } : {}), r.canvasmarker = function (t, e) {
          return new r.CanvasMarker(t, e)
        }, r.CanvasLabel = r.Class.extend(t.NGR_PREFER_CANVAS ? {
          includes: [r.Mixin.Events],
          options: {
            opacity: 1,
            fill: !0,
            stroke: !1,
            color: "#000",
            fillOpacity: 1,
            fillColor: "#000",
            textAlign: "center",
            textBaseline: "middle",
            font: '13px/1.4 "Microsoft YaHei", "Helvetica Neue", Helvetica, STHeiTi, arial, sans-serif',
            textContent: null,
            boundPolygon: null
          },
          initialize: function (t, e) {
            return r.Browser.canvas ? (r.setOptions(this, e), void(this.latlng = r.latLng(t))) : void console.warn("Your browser doesn't support canvas.")
          },
          onAdd: function (t) {
            // 不是
            this._map = t, this._ctx = t._canvasCtx, t._pathRoot || t._initPathRoot(), this._initialized || (this._initialized = !0), this.fire("add"), t.on({
              viewreset: this.projectLatLngs,
              moveend: this._updateLabel
            }, this), this.redraw()
          },
          onRemove: function (t) {
            t.off("viewreset", this.projectLatLngs, this).off("moveend", this._updateLabel, this), this._requestUpdate(), this.fire("remove"), this._map = null
          },
          addTo: function (t) {
            return t.addLayer(this), this
          },
          projectLatLngs: function () {
            this._centerPoint = this._map.latLngToLayerPoint(this.latlng)
          },
          redraw: function () {
            return this._map && (this.projectLatLngs(), this._requestUpdate()), this
          },
          getLatLng: function () {
            return this.latlng
          },
          setLatLng: function (t) {
            this.latlng = t, this.redraw()
          },
          getContent: function () {
            return this.options.textContent
          },
          setContent: function (t) {
            return this.options.textContent = t, this._requestUpdate(), this
          },
          setStyle: function (t) {
            return r.setOptions(this, t), this._map && this._requestUpdate(), this
          },
          _requestUpdate: function () {
            this._map && !r.CanvasLabel._updateRequest && (r.CanvasLabel._updateRequest = r.Util.requestAnimFrame(this._fireMapMoveEnd, this._map))
          },
          _fireMapMoveEnd: function () {
            r.CanvasLabel._updateRequest = null, this.fire("moveend")
          },
          _updateLabel: function () {
            if (null != this.options.textContent) {
              var t = null;
              this.options.boundPolygon && (t = this.options.boundPolygon.getSize());
              var e = this._ctx, i = this._centerPoint, n = this._map.getMaxZoom() - this._map.getZoom() < 2;
              e.save();
              var o = this.options;
              e.beginPath(), e.font = o.font, e.textAlign = o.textAlign, e.textBaseline = o.textBaseline;
              var r = e.measureText(o.textContent).width;
              o.stroke && (e.globalAlpha = o.opacity, e.strokeStyle = o.color, (n || !t || .9 * t.x > r) && e.strokeText(o.textContent, i.x, i.y)), o.fill && (e.globalAlpha = o.fillOpacity, e.fillStyle = o.fillColor || o.color, (n || !t || .9 * t.x > r) && e.fillText(o.textContent, i.x, i.y)), e.restore()
            }
          }
        } : {}), r.canvaslabel = function (t, e) {
          return new r.CanvasLabel(t, e)
        }, r.CanvasLogoLabel = r.Class.extend(t.NGR_PREFER_CANVAS ? {
          includes: [r.Mixin.Events],
          options: {
            logo: {opacity: 1, rotate: 0},
            label: {
              opacity: 1,
              fill: !0,
              stroke: !1,
              color: "#000",
              fillOpacity: 1,
              fillColor: "#000",
              textAlign: "center",
              textBaseline: "middle",
              font: '13px/1.4 "Microsoft YaHei", "Helvetica Neue", Helvetica, STHeiTi, arial, sans-serif',
              textContent: null
            }
          },
          initialize: function (t, e) {
            return r.Browser.canvas ? (r.setOptions(this, e), this._status = "right", this._labelSize = {}, this._commonArea = !1, this._usedDefaultUrl = !1, this.priority = 5, this.latlng = r.latLng(t), this._setImageSize(this.options.logo.size), void this._loadImage()) : void console.warn("Your browser doesn't support canvas.")
          },
          onAdd: function (t) {
            // 这里
            this._map = t,
              this._ctx = t._canvasCtx,
              this._setLabelSize(),
            t._pathRoot || t._initPathRoot(),
              t.on({
                viewreset: this.projectLatLngs,
                moveend: this._updateLogoLabel
              }, this);
            this._initEvents();
            this.redraw(),
              (this._initialized = !0),
              this.fire("add")
          },
          _containsPoint: function (t) {
            return this._imageBounds.contains(t)
          },
          _initEvents: function () {
            // 为facility图层增添事件监听
            this._map.on("mousemove", this._onMouseMove, this);
            this._map.on("click", this._onClick, this);
          },
          _onClick: function (t) {
            this._containsPoint(t.layerPoint) && this.fire("click", t)
          },
          _onMouseMove: function (t) {
            this._map && !this._map._animatingZoom && (
              this._containsPoint(t.layerPoint) ? (
                this._ctx.canvas.style.cursor = "pointer", this._mouseInside = !0, this.fire("mouseover", t))
                : this._mouseInside && (
                  this._ctx.canvas.style.cursor = "", this._mouseInside = !1, this.fire("mouseout", t)))
          },

          onRemove: function (t) {
            t.off("viewreset", this.projectLatLngs, this).off("moveend", this._updateLogoLabel, this), this._requestUpdate(), this.fire("remove"), this._map = null
          },
          addTo: function (t) {
            return t.addLayer(this), this
          },
          projectLatLngs: function () {
            if (this._centerPoint = this._map.latLngToLayerPoint(this.latlng), this._image) {
              if (this._imageLeftTopPoint = this._centerPoint.subtract(this._imageSize.divideBy(2)), this._imageBounds = r.bounds(this._imageLeftTopPoint, this._imageLeftTopPoint.add(this._imageSize)), !this.options.label.textContent)return void(this._bounds = this._imageBounds);
              switch (this._status) {
                case"right":
                  this._labelBasePoint = this._centerPoint.add(r.point(this._labelSize.width.offsetLeft + this._imageSize.x / 2, 0));
                  break;
                case"bottom":
                  this._labelBasePoint = this._centerPoint.add(r.point(0, this._labelSize.height.ascent + this._imageSize.y / 2));
                  break;
                case"left":
                  this._labelBasePoint = this._centerPoint.subtract(r.point(this._labelSize.width.offsetRight + this._imageSize.x / 2, 0));
                  break;
                case"top":
                  this._labelBasePoint = this._centerPoint.subtract(r.point(0, this._labelSize.height.descent + this._imageSize.y / 2));
                  break;
                default:
                  this._labelBasePoint = null
              }
              switch (this._labelBasePoint ? (this._labelLeftTopPoint = this._labelBasePoint.subtract(r.point(this._labelSize.width.offsetLeft, this._labelSize.height.ascent)), this._labelBounds = r.bounds(this._labelLeftTopPoint, this._labelLeftTopPoint.add(r.point(this._labelSize.width.width, this._labelSize.height.height)))) : (this._labelLeftTopPoint = null,
                this._labelBounds = null), this._status) {
                case"onlyLogo":
                  this._bounds = r.bounds(this._imageLeftTopPoint, this._imageLeftTopPoint.add(this._imageSize));
                  break;
                case"hidden":
                  this._bounds = null;
                  break;
                default:
                  this._bounds = r.bounds([this._imageLeftTopPoint, this._imageLeftTopPoint.add(this._imageSize), this._labelLeftTopPoint, this._labelLeftTopPoint.add(r.point(this._labelSize.width.width, this._labelSize.height.height))])
              }
            } else if (this.options.label.textContent) {
              var t = this._labelSize.height, e = this._labelSize.width,
                i = r.point((e.offsetLeft - e.offsetRight) / 2, (t.ascent - t.descent) / 2);
              this._labelBasePoint = this._centerPoint.add(i), this._labelLeftTopPoint = this._centerPoint.subtract(r.point(e.width / 2, t.height / 2)), this._labelBounds = r.bounds(this._labelLeftTopPoint, this._labelLeftTopPoint.add(r.point(e.width, t.height))), this._bounds = this._labelBounds
            }
          },
          redraw: function () {
            return this._map && (this.projectLatLngs(), this._requestUpdate()), this
          },
          getLatLng: function () {
            return this.latlng
          },
          setLatLng: function (t) {
            this.latlng = t, this.redraw()
          },
          getLabelContent: function () {
            return this.options.label.textContent
          },
          setLabelContent: function (t) {
            return this.options.label.textContent = t, this._requestUpdate(), this
          },
          setStyle: function (t) {
            return r.setOptions(this, t), this._map && (this._setImageSize(), this._setLabelSize(), this._loadImage(), this.projectLatLngs(), this._requestUpdate()), this
          },
          _setStatus: function (t) {
            if (this._status !== t) {
              var e = ["right", "bottom", "left", "top", "onlyLogo", "hidden"], i = !1;
              for (var n in e)if (t === e[n]) {
                this._status = t, this.projectLatLngs(), this._requestUpdate(), i = !0;
                break
              }
              return i ? void 0 : void console.warn("Set Status Failed")
            }
          },
          _getStatus: function () {
            return this._status
          },
          getBounds: function (t) {
            if (!t || !this._image && this.options.label.textContent)return this._bounds;
            if (!this.options.label.textContent)return this._imageBounds;
            var e = null, i = null, n = null;
            switch (t) {
              case"right":
                e = this._centerPoint.add(r.point(this._labelSize.width.offsetLeft + this._imageSize.x / 2, 0));
                break;
              case"bottom":
                e = this._centerPoint.add(r.point(0, this._labelSize.height.ascent + this._imageSize.y / 2));
                break;
              case"left":
                e = this._centerPoint.subtract(r.point(this._labelSize.width.offsetRight + this._imageSize.x / 2, 0));
                break;
              case"top":
                e = this._centerPoint.subtract(r.point(0, this._labelSize.height.descent + this._imageSize.y / 2));
                break;
              case"onlyLogo":
                return this._imageBounds;
              case"hidden":
                return null;
              default:
                return void console.warn("Invalid Status")
            }
            return i = e.subtract(r.point(this._labelSize.width.offsetLeft, this._labelSize.height.ascent)), n = r.bounds([this._imageLeftTopPoint, this._imageLeftTopPoint.add(this._imageSize), i, i.add(r.point(this._labelSize.width.width, this._labelSize.height.height))])
          },
          getLogoBounds: function () {
            return this._imageBounds
          },
          getLabelBounds: function (t) {
            if (!t)return console.warn("Invalid Status"), null;
            if (!this.options.label.textContent)return null;
            if (!this._image) {
              var e = ["right", "bottom", "left", "top"], i = null;
              return e.indexOf(t) !== -1 ? i = this._bounds : "onlyLogo" === t && "hidden" === t && console.warn("Invalid Status"), i
            }
            var n = null, o = null, s = null;
            switch (t) {
              case"right":
                n = this._centerPoint.add(r.point(this._labelSize.width.offsetLeft + this._imageSize.x / 2, 0));
                break;
              case"bottom":
                n = this._centerPoint.add(r.point(0, this._labelSize.height.ascent + this._imageSize.y / 2));
                break;
              case"left":
                n = this._centerPoint.subtract(r.point(this._labelSize.width.offsetRight + this._imageSize.x / 2, 0));
                break;
              case"top":
                n = this._centerPoint.subtract(r.point(0, this._labelSize.height.descent + this._imageSize.y / 2));
                break;
              case"onlyLogo":
                return null;
              case"hidden":
                return null;
              default:
                return console.warn("Invalid Status"), null
            }
            return o = n.subtract(r.point(this._labelSize.width.offsetLeft, this._labelSize.height.ascent)), s = r.bounds(o, o.add(r.point(this._labelSize.width.width, this._labelSize.height.height)))
          },
          _requestUpdate: function () {
            this._map && !r.CanvasLogoLabel._updateRequest && (r.CanvasLogoLabel._updateRequest = r.Util.requestAnimFrame(this._fireMapMoveEnd, this._map))
          },
          _fireMapMoveEnd: function () {
            r.CanvasLogoLabel._updateRequest = null, this.fire("moveend")
          },
          _updateLogoLabel: function () {
            try {
              // console.log('update')
              "hidden" !== this._status && (this._ctx.save(),
                this._ctx.globalAlpha = this.options.logo.opacity,
              this.options.logo.rotate && (this._ctx.translate(this._centerPoint.x, this._centerPoint.y), this._ctx.rotate(this.options.logo.rotate), this._ctx.translate(-this._centerPoint.x, -this._centerPoint.y)),
                // 填入logo
              this._image && this._image.complete && this._ctx.drawImage(this._image, this._imageLeftTopPoint.x, this._imageLeftTopPoint.y, this._imageSize.x, this._imageSize.y),
                this._ctx.restore(),
                // console.log(this._imageLeftTopPoint.x, this._imageLeftTopPoint.y, this._imageSize.x, this._imageSize.y),
                // 为canvas加入事件侦听
              "onlyLogo" !== this._status && this.options.label.textContent && (this._ctx.save(),
                this._ctx.beginPath(),
                this._ctx.font = this.options.label.font,
                this._ctx.textAlign = this.options.label.textAlign,
                this._ctx.textBaseline = this.options.label.textBaseline,
              this.options.label.stroke && (this._ctx.globalAlpha = this.options.label.opacity,
                this._ctx.strokeStyle = this.options.label.color,
                this._ctx.strokeText(this.options.label.textContent, this._labelBasePoint.x, this._labelBasePoint.y, this._labelSize.width.width)),
              this.options.label.fill && (this._ctx.globalAlpha = this.options.label.fillOpacity,
                this._ctx.fillStyle = this.options.label.fillColor || this.options.label.color,
                this._ctx.fillText(this.options.label.textContent, this._labelBasePoint.x, this._labelBasePoint.y, this._labelSize.width.width)),
                this._ctx.restore()))
            }
            catch (e) {

            }
          },
          _loadImage: function () {
            console.log(this.options.logo.url)
            return (this.options.logo.url) ? (this._image = new Image,
              this._image.addEventListener("load", function (t) {
                return function () {
                  t._imageSize || t._setImageSize([t._image.width, t._image.height]), t._map && t.redraw()
                }
              }(this), !1),
              this._image.addEventListener("error", function (t) {
                return function () {
                  t.options.logo.defaultUrl && !t._usedDefaultUrl ? (t._image.src = t.options.logo.defaultUrl, t._usedDefaultUrl = !0, t._commonArea = !0) : (t._image = null, t.redraw())
                }
              }(this), !1),
              // icons地址
              // void(this._image.src = 'http://localhost:3000/icons/' + this.options.logo.url.split('/').pop() + '.png'))
              void(this._image.src = 'https://yxys.io/icons/' + this.options.logo.url.split('/').pop() + '.png'))
              : void(this._image = null)
          },
          _setImageSize: function (t) {
            if (t) {
              var e;
              return e = r.point(t), e && e.x && e.x > 0 && e.y && e.y > 0 ? void(this._imageSize = e) : void console.warn("Invalid Size")
            }
          },
          _getTextHeight: function (t, e) {
            if (!t || "string" != typeof t)return void cosole.warn("Invalid content");
            var n = i.createElement("span");
            n.innerHTML = t, n.style.font = e, n.style.opacity = "0";
            var o = i.createElement("div");
            o.style.display = "inline-block", o.style.width = "1px", o.style.height = "0";
            var r = i.createElement("div");
            r.appendChild(n), r.appendChild(o);
            var s = i.body;
            s.appendChild(r);
            var a = {};
            try {
              o.style.verticalAlign = "baseline", a.ascent = o.offsetTop - n.offsetTop, o.style.verticalAlign = "bottom", a.height = o.offsetTop - n.offsetTop, a.descent = a.height - a.ascent
            } finally {
              s.removeChild(r)
            }
            return a
          },
          _setLabelSize: function () {
            if (!this.options.label.textContent)return void(this._labelSize = null);
            switch (this._labelSize.height = this._getTextHeight(this.options.label.textContent, this.options.label.font), this.options.label.textBaseline) {
              case"top":
                this._labelSize.height.ascent = 0, this._labelSize.height.descent = this._labelSize.height.height;
                break;
              case"bottom":
                this._labelSize.height.ascent = this._labelSize.height.height, this._labelSize.height.descent = 0;
                break;
              case"alphabetic":
                break;
              default:
                this.options.label.textBaseline = "middle", this._labelSize.height.ascent = this._labelSize.height.height / 2, this._labelSize.height.descent = this._labelSize.height.height / 2
            }
            switch (this._labelSize.width = {}, this._ctx.font = this.options.label.font, this._labelSize.width.width = this._ctx.measureText(this.options.label.textContent).width, this.options.label.textAlign) {
              case"left":
                this._labelSize.width.offsetLeft = 0, this._labelSize.width.offsetRight = this._labelSize.width.width;
                break;
              case"right":
                this._labelSize.width.offsetLeft = this._labelSize.width.width, this._labelSize.width.offsetRight = 0;
                break;
              default:
                this.options.label.textAlign = "center", this._labelSize.width.offsetLeft = this._labelSize.width.width / 2, this._labelSize.width.offsetRight = this._labelSize.width.width / 2
            }
          }
        } : {}), r.canvaslogolabel = function (t, e) {
          return new r.CanvasLogoLabel(t, e)
        }, r.DivIcon = r.Icon.extend({
          options: {iconSize: [12, 12], className: "ngr-div-icon", html: !1},
          createIcon: function (t) {
            var e = t && "DIV" === t.tagName ? t : i.createElement("div"), n = this.options;
            return n.html !== !1 ? e.innerHTML = n.html : e.innerHTML = "", n.bgPos && (e.style.backgroundPosition = -n.bgPos.x + "px " + -n.bgPos.y + "px"), this._setIconStyles(e, "icon"), e
          },
          createShadow: function () {
            return null
          }
        }), r.divIcon = function (t) {
          return new r.DivIcon(t)
        }, r.Map.mergeOptions({closePopupOnClick: !0}), r.Popup = r.Class.extend({
          includes: r.Mixin.Events,
          options: {
            minWidth: 50,
            maxWidth: 300,
            autoPan: !0,
            closeButton: !0,
            offset: [0, 7],
            autoPanPadding: [5, 5],
            keepInView: !1,
            className: "",
            zoomAnimation: !0,
            autoClose: !0
          },
          initialize: function (t, e) {
            r.setOptions(this, t), this._source = e, this._animated = r.Browser.any3d && this.options.zoomAnimation, this._isOpen = !1
          },
          onAdd: function (t) {
            this._map = t, t.fire("beforepopupopen", {popup: this}), this._source && this._source.fire("beforepopupopen", {popup: this}), this._container || this._initLayout();
            var e = t.options.fadeAnimation;
            e && r.DomUtil.setOpacity(this._container, 0), t._panes.popupPane.appendChild(this._container), t.on(this._getEvents(), this), this.update(), e && r.DomUtil.setOpacity(this._container, 1), this.fire("open"), t.fire("popupopen", {popup: this}), this._source && this._source.fire("popupopen", {popup: this})
          },
          addTo: function (t) {
            return t.addLayer(this), this
          },
          openOn: function (t) {
            return t.openPopup(this), this
          },
          onRemove: function (t) {
            t.fire("beforepopupclose", {popup: this}), this._source && this._source.fire("beforepopupclose", {popup: this}), t._panes.popupPane.removeChild(this._container), r.Util.falseFn(this._container.offsetWidth), t.off(this._getEvents(), this), t.options.fadeAnimation && r.DomUtil.setOpacity(this._container, 0), this._map = null, this.fire("close"), t.fire("popupclose", {popup: this}), this._source && this._source.fire("popupclose", {popup: this})
          },
          getLatLng: function () {
            return this._latlng
          },
          setLatLng: function (t) {
            return this._latlng = r.latLng(t), this._map && (this._updatePosition(), this._adjustPan()), this
          },
          getContent: function () {
            return this._content
          },
          setContent: function (t) {
            return this._content = t, this.update(), this
          },
          update: function () {
            this._map && (this._container.style.visibility = "hidden", this._updateContent(), this._updateLayout(), this._updatePosition(), this._container.style.visibility = "", this._adjustPan())
          },
          _getEvents: function () {
            var t = {viewreset: this._updatePosition};
            return this._animated && (t.zoomanim = this._zoomAnimation), ("closeOnClick" in this.options ? this.options.closeOnClick : this._map.options.closePopupOnClick) && (t.preclick = this._close), this.options.keepInView && (t.moveend = this._adjustPan), t
          },
          _close: function () {
            this._map && this._map.closePopup(this)
          },
          _initLayout: function () {
            var t, e = "ngr-popup",
              i = e + " " + this.options.className + " ngr-zoom-" + (this._animated ? "animated" : "hide"),
              n = this._container = r.DomUtil.create("div", i);
            this.options.closeButton && (t = this._closeButton = r.DomUtil.create("a", e + "-close-button", n), t.href = "#close", t.innerHTML = "&#215;", r.DomEvent.disableClickPropagation(t), r.DomEvent.on(t, "click", this._onCloseButtonClick, this));
            var o = this._wrapper = r.DomUtil.create("div", e + "-content-wrapper", n);
            r.DomEvent.disableClickPropagation(o), this._contentNode = r.DomUtil.create("div", e + "-content", o), r.DomEvent.disableScrollPropagation(this._contentNode), r.DomEvent.on(o, "contextmenu", r.DomEvent.stopPropagation), this._tipContainer = r.DomUtil.create("div", e + "-tip-container", n), this._tip = r.DomUtil.create("div", e + "-tip", this._tipContainer)
          },
          _updateContent: function () {
            if (this._content) {
              if ("string" == typeof this._content) this._contentNode.innerHTML = this._content; else {
                for (; this._contentNode.hasChildNodes();)this._contentNode.removeChild(this._contentNode.firstChild);
                this._contentNode.appendChild(this._content)
              }
              this.fire("contentupdate")
            }
          },
          _updateLayout: function () {
            var t = this._contentNode, e = t.style;
            e.width = "", e.whiteSpace = "nowrap";
            var i = t.offsetWidth;
            i = Math.min(i, this.options.maxWidth), i = Math.max(i, this.options.minWidth), e.width = i + 1 + "px", e.whiteSpace = "", e.height = "";
            var n = t.offsetHeight, o = this.options.maxHeight, s = "ngr-popup-scrolled";
            o && n > o ? (e.height = o + "px", r.DomUtil.addClass(t, s)) : r.DomUtil.removeClass(t, s), this._containerWidth = this._container.offsetWidth
          },
          _updatePosition: function () {
            if (this._map) {
              var t = this._map.latLngToLayerPoint(this._latlng), e = this._animated, i = r.point(this.options.offset);
              e && r.DomUtil.setPosition(this._container, t), this._containerBottom = -i.y - (e ? 0 : t.y), this._containerLeft = -Math.round(this._containerWidth / 2) + i.x + (e ? 0 : t.x), this._container.style.bottom = this._containerBottom + "px", this._container.style.left = this._containerLeft + "px"
            }
          },
          _zoomAnimation: function (t) {
            var e = this._map._latLngToNewLayerPoint(this._latlng, t.zoom, t.center);
            r.DomUtil.setPosition(this._container, e)
          },
          _adjustPan: function () {
            if (this.options.autoPan) {
              var t = this._map, e = this._container.offsetHeight, i = this._containerWidth,
                n = new r.Point(this._containerLeft, -e - this._containerBottom);
              this._animated && n._add(r.DomUtil.getPosition(this._container));
              var o = t.layerPointToContainerPoint(n), s = r.point(this.options.autoPanPadding),
                a = r.point(this.options.autoPanPaddingTopLeft || s),
                h = r.point(this.options.autoPanPaddingBottomRight || s), l = t.getSize(), u = 0, c = 0;
              o.x + i + h.x > l.x && (u = o.x + i - l.x + h.x), o.x - u - a.x < 0 && (u = o.x - a.x), o.y + e + h.y > l.y && (c = o.y + e - l.y + h.y), o.y - c - a.y < 0 && (c = o.y - a.y), (u || c) && t.fire("autopanstart").panBy([u, c])
            }
          },
          _onCloseButtonClick: function (t) {
            this._close(), r.DomEvent.stop(t)
          }
        }), r.popup = function (t, e) {
          return new r.Popup(t, e)
        }, r.Map.include({
          openPopup: function (t, e, i) {
            if (this._popup && this._popup.options.autoClose && this.closePopup(), !(t instanceof r.Popup)) {
              var n = t;
              t = new r.Popup(i).setLatLng(e).setContent(n)
            }
            return t._isOpen = !0, this._popup = t, this.addLayer(t)
          }, closePopup: function (t) {
            return t && t !== this._popup || (t = this._popup, this._popup = null), t && (this.removeLayer(t), t._isOpen = !1), this
          }
        }), r.Marker.include({
          openPopup: function () {
            return this._popup && this._map && !this._map.hasLayer(this._popup) && (this._popup.setLatLng(this._latlng), this._map.openPopup(this._popup)), this
          }, closePopup: function () {
            return this._popup && this._popup._close(), this
          }, togglePopup: function () {
            return this._popup && (this._popup._isOpen ? this.closePopup() : this.openPopup()), this
          }, bindPopup: function (t, e) {
            var i = r.point(this.options.icon.options.popupAnchor || [0, 0]);
            return i = i.add(r.Popup.prototype.options.offset), e && e.offset && (i = i.add(e.offset)), e = r.extend({offset: i}, e), this._popupHandlersAdded || (this.on("click", this.togglePopup, this).on("remove", this.closePopup, this).on("move", this._movePopup, this), this._popupHandlersAdded = !0), t instanceof r.Popup ? (r.setOptions(t, e), this._popup = t) : this._popup = new r.Popup(e, this).setContent(t), this
          }, setPopupContent: function (t) {
            return this._popup && this._popup.setContent(t), this
          }, unbindPopup: function () {
            return this._popup && (this._popup = null, this.off("click", this.togglePopup, this).off("remove", this.closePopup, this).off("move", this._movePopup, this), this._popupHandlersAdded = !1), this
          }, getPopup: function () {
            return this._popup
          }, _movePopup: function (t) {
            this._popup.setLatLng(t.latlng)
          }
        }), r.LayerGroup = r.Class.extend({
          initialize: function (t) {
            this._layers = {};
            var e, i;
            if (t)for (e = 0, i = t.length; e < i; e++)this.addLayer(t[e])
          }, addLayer: function (t) {
            var e = this.getLayerId(t);
            return this._layers[e] = t, this._map && this._map.addLayer(t), this
          }, removeLayer: function (t) {
            var e = t in this._layers ? t : this.getLayerId(t);
            return this._map && this._layers[e] && this._map.removeLayer(this._layers[e]), delete this._layers[e], this
          }, hasLayer: function (t) {
            return !!t && (t in this._layers || this.getLayerId(t) in this._layers)
          }, clearLayers: function () {
            return this.eachLayer(this.removeLayer, this), this
          }, invoke: function (t) {
            var e, i, n = Array.prototype.slice.call(arguments, 1);
            for (e in this._layers)i = this._layers[e], i[t] && i[t].apply(i, n);
            return this
          }, onAdd: function (t) {
            // 两大group addLayer入口
            this._map = t, this.eachLayer(t.addLayer, t)
          }, onRemove: function (t) {
            this.eachLayer(t.removeLayer, t), this._map = null
          }, addTo: function (t) {
            return t.addLayer(this), this
          }, eachLayer: function (t, e) {
            for (var i in this._layers)t.call(e, this._layers[i]);
            return this
          }, getLayer: function (t) {
            return this._layers[t]
          }, getLayers: function () {
            var t = [];
            for (var e in this._layers)t.push(this._layers[e]);
            return t
          }, setZIndex: function (t) {
            return this.invoke("setZIndex", t)
          }, getLayerId: function (t) {
            return r.stamp(t)
          }
        }), r.layerGroup = function (t) {
          return new r.LayerGroup(t)
        }, r.FeatureGroup = r.LayerGroup.extend({
          includes: r.Mixin.Events,
          statics: {EVENTS: "click dblclick mouseover mouseout mousemove contextmenu popupopen popupclose"},
          addLayer: function (t) {
            // 新增单个图层(最早调用） this 是Map对象，t是单个图层对象
            return this.hasLayer(t) ? this :
              ("on" in t && t.on(r.FeatureGroup.EVENTS, this._propagateEvent, this),
                r.LayerGroup.prototype.addLayer.call(this, t),
              this._popupContent && t.bindPopup && t.bindPopup(this._popupContent, this._popupOptions),
                this.fire("layeradd", {layer: t}))
          },
          removeLayer: function (t) {
            return this.hasLayer(t) ? (t in this._layers && (t = this._layers[t]), t.off(r.FeatureGroup.EVENTS, this._propagateEvent, this), r.LayerGroup.prototype.removeLayer.call(this, t), this._popupContent && this.invoke("unbindPopup"), this.fire("layerremove", {layer: t})) : this
          },
          bindPopup: function (t, e) {
            return this._popupContent = t, this._popupOptions = e, this.invoke("bindPopup", t, e)
          },
          openPopup: function (t) {
            for (var e in this._layers) {
              this._layers[e].openPopup(t);
              break
            }
            return this
          },
          setStyle: function (t) {
            return this.invoke("setStyle", t)
          },
          bringToFront: function () {
            return this.invoke("bringToFront")
          },
          bringToBack: function () {
            return this.invoke("bringToBack")
          },
          getBounds: function () {
            var t = new r.LatLngBounds;
            return this.eachLayer(function (e) {
              t.extend(e instanceof r.Marker ? e.getLatLng() : e.getBounds())
            }), t
          },
          _propagateEvent: function (t) {
            t = r.extend({layer: t.target, target: this}, t), this.fire(t.type, t)
          }
        }), r.featureGroup = function (t) {
          return new r.FeatureGroup(t)
        }, r.Path = r.Class.extend({
          includes: [r.Mixin.Events],
          statics: {
            CLIP_PADDING: function () {
              var e = r.Browser.mobile ? 1280 : 2e3, i = (e / Math.max(t.outerWidth, t.outerHeight) - 1) / 2;
              return Math.max(0, Math.min(.5, i))
            }()
          },
          options: {
            stroke: !0,
            color: "#0033ff",
            dashArray: null,
            lineCap: null,
            lineJoin: null,
            weight: 5,
            opacity: .5,
            fill: !1,
            fillColor: null,
            fillOpacity: .2,
            clickable: !0
          },
          initialize: function (t) {
            r.setOptions(this, t)
          },
          onAdd: function (t) {
            // Path的函数 collision, facility图层添加后并不调用onAdd
            //frame和area对象
            this._map = t, this._container || (this._initElements(), this._initEvents()), this.projectLatlngs(), this._updatePath(), this._container && this._map._pathRoot.appendChild(this._container), this.fire("add"), t.on({
              viewreset: this.projectLatlngs,
              moveend: this._updatePath
            }, this)
          },
          addTo: function (t) {
            return t.addLayer(this), this
          },
          onRemove: function (t) {
            t._pathRoot.removeChild(this._container), this.fire("remove"), this._map = null, r.Browser.vml && (this._container = null, this._stroke = null, this._fill = null), t.off({
              viewreset: this.projectLatlngs,
              moveend: this._updatePath
            }, this)
          },
          projectLatlngs: function () {
          },
          setStyle: function (t) {
            return r.setOptions(this, t), this._container && this._updateStyle(), this
          },
          redraw: function () {
            return this._map && (this.projectLatlngs(), this._updatePath()), this
          }
        }), r.Map.include({
          _updatePathViewport: function () {
            var t = r.Path.CLIP_PADDING, e = this.getSize(), i = r.DomUtil.getPosition(this._mapPane),
              n = i.multiplyBy(-1)._subtract(e.multiplyBy(t)._round()), o = n.add(e.multiplyBy(1 + 2 * t)._round());
            this._pathViewport = new r.Bounds(n, o)
          }
        }), r.Path.SVG_NS = "http://www.w3.org/2000/svg", r.Browser.svg = !(!i.createElementNS || !i.createElementNS(r.Path.SVG_NS, "svg").createSVGRect), r.Path = r.Path.extend({
          statics: {SVG: r.Browser.svg},
          bringToFront: function () {
            // polygon图层
            var t = this._map._pathRoot, e = this._container;
            return e && t.lastChild !== e && t.appendChild(e), this
          },
          bringToBack: function () {
            var t = this._map._pathRoot, e = this._container, i = t.firstChild;
            return e && i !== e && t.insertBefore(e, i), this
          },
          getPathString: function () {
          },
          _createElement: function (t) {
            return i.createElementNS(r.Path.SVG_NS, t)
          },
          _initElements: function () {
            this._map._initPathRoot(), this._initPath(), this._initStyle()
          },
          _initPath: function () {
            this._container = this._createElement("g"), this._path = this._createElement("path"), this.options.className && r.DomUtil.addClass(this._path, this.options.className), this._container.appendChild(this._path)
          },
          _initStyle: function () {
            this.options.stroke && (this._path.setAttribute("stroke-linejoin", "round"), this._path.setAttribute("stroke-linecap", "round")), this.options.fill && this._path.setAttribute("fill-rule", "evenodd"), this.options.pointerEvents && this._path.setAttribute("pointer-events", this.options.pointerEvents), this.options.clickable || this.options.pointerEvents || this._path.setAttribute("pointer-events", "none"), this._updateStyle()
          },
          _updateStyle: function () {
            this.options.stroke ? (this._path.setAttribute("stroke", this.options.color), this._path.setAttribute("stroke-opacity", this.options.opacity), this._path.setAttribute("stroke-width", this.options.weight), this.options.dashArray ? this._path.setAttribute("stroke-dasharray", this.options.dashArray) : this._path.removeAttribute("stroke-dasharray"), this.options.lineCap && this._path.setAttribute("stroke-linecap", this.options.lineCap), this.options.lineJoin && this._path.setAttribute("stroke-linejoin", this.options.lineJoin)) : this._path.setAttribute("stroke", "none"), this.options.fill ? (this._path.setAttribute("fill", this.options.fillColor || this.options.color), this._path.setAttribute("fill-opacity", this.options.fillOpacity)) : this._path.setAttribute("fill", "none")
          },
          _updatePath: function () {
            var t = this.getPathString();
            t || (t = "M0 0"), this._path.setAttribute("d", t)
          },
          _initEvents: function () {
            if (this.options.clickable) {
              !r.Browser.svg && r.Browser.vml || r.DomUtil.addClass(this._path, "ngr-clickable"), r.DomEvent.on(this._container, "click", this._onMouseClick, this);
              for (var t = ["dblclick", "mousedown", "mouseover", "mouseout", "mousemove", "contextmenu"],
                     e = 0; e < t.length; e++)r.DomEvent.on(this._container, t[e], this._fireMouseEvent, this)
            }
          },
          _onMouseClick: function (t) {
            this._map.dragging && this._map.dragging.moved() || this._fireMouseEvent(t)
          },
          _fireMouseEvent: function (t) {
            if (this.hasEventListeners(t.type)) {
              var e = this._map, i = e.mouseEventToContainerPoint(t), n = e.containerPointToLayerPoint(i),
                o = e.layerPointToLatLng(n);
              this.fire(t.type, {
                latlng: o,
                layerPoint: n,
                containerPoint: i,
                originalEvent: t
              }), "contextmenu" === t.type && r.DomEvent.preventDefault(t), "mousemove" !== t.type && r.DomEvent.stopPropagation(t)
            }
          }
        }), r.Map.include({
          _initPathRoot: function () {
            this._pathRoot || (this._pathRoot = r.Path.prototype._createElement("svg"), this._panes.overlayPane.appendChild(this._pathRoot), this.options.zoomAnimation && r.Browser.any3d ? (r.DomUtil.addClass(this._pathRoot, "ngr-zoom-animated"), this.on({
              zoomanim: this._animatePathZoom,
              zoomend: this._endPathZoom
            })) : r.DomUtil.addClass(this._pathRoot, "ngr-zoom-hide"), this.on("moveend", this._updateSvgViewport), this._updateSvgViewport())
          }, _animatePathZoom: function (t) {
            var e = this.getZoomScale(t.zoom),
              i = this._getCenterOffset(t.center)._multiplyBy(-e)._add(this._pathViewport.min);
            this._pathRoot.style[r.DomUtil.TRANSFORM] = r.DomUtil.getTranslateString(i) + " scale(" + e + ") ", this._pathZooming = !0
          }, _endPathZoom: function () {
            this._pathZooming = !1
          }, _updateSvgViewport: function () {
            if (!this._pathZooming) {
              this._updatePathViewport();
              var t = this._pathViewport, e = t.min, i = t.max, n = i.x - e.x, o = i.y - e.y, s = this._pathRoot,
                a = this._panes.overlayPane;
              r.Browser.mobileWebkit && a.removeChild(s), r.DomUtil.setPosition(s, e), s.setAttribute("width", n), s.setAttribute("height", o), s.setAttribute("viewBox", [e.x, e.y, n, o].join(" ")), r.Browser.mobileWebkit && a.appendChild(s)
            }
          }
        }), r.Path.include({
          bindPopup: function (t, e) {
            return t instanceof r.Popup ? this._popup = t : (this._popup && !e || (this._popup = new r.Popup(e, this)), this._popup.setContent(t)), this._popupHandlersAdded || (this.on("click", this._openPopup, this).on("remove", this.closePopup, this), this._popupHandlersAdded = !0), this
          }, unbindPopup: function () {
            return this._popup && (this._popup = null, this.off("click", this._openPopup).off("remove", this.closePopup), this._popupHandlersAdded = !1), this
          }, openPopup: function (t) {
            return this._popup && (t = t || this._latlng || this._latlngs[Math.floor(this._latlngs.length / 2)], this._openPopup({latlng: t})), this
          }, closePopup: function () {
            return this._popup && this._popup._close(), this
          }, _openPopup: function (t) {
            this._popup.setLatLng(t.latlng), this._map.openPopup(this._popup)
          }
        }), r.Browser.vml = !r.Browser.svg && function () {
            try {
              var t = i.createElement("div");
              t.innerHTML = '<v:shape adj="1"/>';
              var e = t.firstChild;
              return e.style.behavior = "url(#default#VML)", e && "object" == typeof e.adj
            } catch (n) {
              return !1
            }
          }(), r.Path = r.Browser.svg || !r.Browser.vml ? r.Path : r.Path.extend({
          statics: {
            VML: !0,
            CLIP_PADDING: .02
          }, _createElement: function () {
            try {
              return i.namespaces.add("lvml", "urn:schemas-microsoft-com:vml"), function (t) {
                return i.createElement("<lvml:" + t + ' class="lvml">')
              }
            } catch (t) {
              return function (t) {
                return i.createElement("<" + t + ' xmlns="urn:schemas-microsoft.com:vml" class="lvml">')
              }
            }
          }(), _initPath: function () {
            var t = this._container = this._createElement("shape");
            r.DomUtil.addClass(t, "ngr-vml-shape" + (this.options.className ? " " + this.options.className : "")), this.options.clickable && r.DomUtil.addClass(t, "ngr-clickable"), t.coordsize = "1 1", this._path = this._createElement("path"), t.appendChild(this._path), this._map._pathRoot.appendChild(t)
          }, _initStyle: function () {
            this._updateStyle()
          }, _updateStyle: function () {
            var t = this._stroke, e = this._fill, i = this.options, n = this._container;
            n.stroked = i.stroke, n.filled = i.fill, i.stroke ? (t || (t = this._stroke = this._createElement("stroke"), t.endcap = "round", n.appendChild(t)), t.weight = i.weight + "px", t.color = i.color, t.opacity = i.opacity, i.dashArray ? t.dashStyle = r.Util.isArray(i.dashArray) ? i.dashArray.join(" ") : i.dashArray.replace(/( *, *)/g, " ") : t.dashStyle = "", i.lineCap && (t.endcap = i.lineCap.replace("butt", "flat")), i.lineJoin && (t.joinstyle = i.lineJoin)) : t && (n.removeChild(t), this._stroke = null), i.fill ? (e || (e = this._fill = this._createElement("fill"), n.appendChild(e)), e.color = i.fillColor || i.color, e.opacity = i.fillOpacity) : e && (n.removeChild(e), this._fill = null)
          }, _updatePath: function () {
            var t = this._container.style;
            t.display = "none", this._path.v = this.getPathString() + " ", t.display = ""
          }
        }), r.Map.include(r.Browser.svg || !r.Browser.vml ? {} : {
          _initPathRoot: function () {
            if (!this._pathRoot) {
              var t = this._pathRoot = i.createElement("div");
              t.className = "ngr-vml-container", this._panes.overlayPane.appendChild(t), this.on("moveend", this._updatePathViewport), this._updatePathViewport()
            }
          }
        }), r.Browser.canvas = function () {

          return !!i.createElement("canvas").getContext
        }(), r.Path = r.Path.SVG && !t.NGR_PREFER_CANVAS || !r.Browser.canvas ? r.Path : r.Path.extend({
          statics: {
            CANVAS: !0,
            SVG: !1
          }, redraw: function () {
            return this._map && (this.projectLatlngs(), this._requestUpdate()), this
          }, setStyle: function (t) {
            return r.setOptions(this, t), this._map && (this._updateStyle(), this._requestUpdate()), this
          }, onRemove: function (t) {
            t.off("viewreset", this.projectLatlngs, this).off("moveend", this._updatePath, this), this.options.clickable && (this._map.off("click", this._onClick, this), this._map.off("mousemove", this._onMouseMove, this)), this._requestUpdate(), this.fire("remove"), this._map = null
          }, _requestUpdate: function () {
            this._map && !r.Path._updateRequest && (r.Path._updateRequest = r.Util.requestAnimFrame(this._fireMapMoveEnd, this._map))
          }, _fireMapMoveEnd: function () {
            r.Path._updateRequest = null, this.fire("moveend")
          }, _initElements: function () {
            this._map._initPathRoot(), this._ctx = this._map._canvasCtx
          }, _updateStyle: function () {
            var t = this.options;
            t.stroke && (this._ctx.lineWidth = t.weight, this._ctx.strokeStyle = t.color, t.lineCap && (this._ctx.lineCap = t.lineCap), t.lineJoin && (this._ctx.lineJoin = t.lineJoin), t.dashArray && this._ctx.setLineDash(t.dashArray)), t.fill && (this._ctx.fillStyle = t.fillColor || t.color)
          }, _drawPath: function () {
            var t, e, i, n, o, s, a = this.options.weight % 2 / 2;
            for (this._ctx.beginPath(), t = 0, i = this._parts.length; t < i; t++) {
              for (e = 0, n = this._parts[t].length; e < n; e++)o = this._parts[t][e], s = (0 === e ? "move" : "line") + "To", this._ctx[s](o.x + a, o.y + a);
              this instanceof r.Polygon && this._ctx.closePath()
            }
          }, _checkIfEmpty: function () {
            return !this._parts.length
          }, _drawArrow: function () {
            var t, e, i, n, o, r, s;
            for (t = 0, i = this._parts.length; t < i; ++t)for (e = 1, n = this._parts[t].length; e < n; e++)o = this._parts[t][e], r = this._parts[t][e - 1], s = Math.atan((o.x - r.x) / (o.y - r.y)), s = o.y - r.y >= 0 ? -s : Math.PI - s, this._ctx.save(), this._ctx.translate(o.x, o.y), this._ctx.beginPath(), this._ctx.setLineDash([0]), this._ctx.strokeStyle = this.options.color, this._ctx.fillStyle = this.options.color, this._ctx.globalAlpha = 1, this._ctx.lineCap = "butt", this._ctx.lineJoin = "miter", this._ctx.rotate(s), this._ctx.lineTo(-5, -10), this._ctx.lineTo(0, -5), this._ctx.lineTo(5, -10), this._ctx.lineTo(0, 0), this._ctx.closePath(), this._ctx.fill(), this._ctx.stroke(), this._ctx.restore()
          }, _updatePath: function () {
            if (!this._checkIfEmpty()) {
              var t = this._ctx, e = this.options;
              this._drawPath(), t.save(), this._updateStyle(), e.fill && (t.globalAlpha = e.fillOpacity, t.fill()), e.stroke && (t.globalAlpha = e.opacity, t.stroke()), e.arrow && this._drawArrow(), t.restore()
            }
          }, _initEvents: function () {
            //只有area和Frame图层触发此函数 目标
            this.options.clickable && (this._map.on("mousemove", this._onMouseMove, this), this._map.on("click", this._onClick, this))
          }, _onClick: function (t) {
            this._containsPoint(t.layerPoint) && this.fire("click", t)
          }, _onMouseMove: function (t) {
            // 触发鼠标移动后根据鼠标位置把move转为对应的类型
            this._map && !this._map._animatingZoom && (
              this._containsPoint(t.layerPoint) ? (
                this._ctx.canvas.style.cursor = "pointer", this._mouseInside = !0, this.fire("mouseover", t))
                : this._mouseInside && (
                  this._ctx.canvas.style.cursor = "", this._mouseInside = !1, this.fire("mouseout", t)))
          }
        }), r.Map.include(r.Path.SVG && !t.NGR_PREFER_CANVAS || !r.Browser.canvas ? {} : {
          _initPathRoot: function () {

            var t, e = this._pathRoot;
            e || (e = this._pathRoot = i.createElement("canvas"), e.style.position = "absolute", t = this._canvasCtx = e.getContext("2d"), t.lineCap = "round", t.lineJoin = "round", this._panes.overlayPane.appendChild(e), this.options.zoomAnimation && (this._pathRoot.className = "ngr-zoom-animated", this.on("zoomanim", this._animatePathZoom), this.on("zoomend", this._endPathZoom)), this.on("moveend", this._updateCanvasViewport), this._updateCanvasViewport())
          }, _updateCanvasViewport: function () {
            if (!this._pathZooming) {
              this._updatePathViewport();
              var e = this._pathViewport, i = e.min, n = e.max.subtract(i), o = this._pathRoot;
              r.DomUtil.setPosition(o, i);
              var s = t.devicePixelRatio || 1, a = r.Browser.mobile && !r.Browser.android || r.Browser.android23;
              s = a && n.x * n.y * s * s > 5e6 ? 1 : s, o.width = n.x * s, o.height = n.y * s, 1 != s && (o.style.width = n.x + "px", o.style.height = n.y + "px", o.getContext("2d").scale(s, s)), o.getContext("2d").translate(-i.x, -i.y)
            }
          }
        }), r.LineUtil = {
          simplify: function (t, e) {
            if (!e || !t.length)return t.slice();
            var i = e * e;
            return t = this._reducePoints(t, i), t = this._simplifyDP(t, i)
          }, pointToSegmentDistance: function (t, e, i) {
            return Math.sqrt(this._sqClosestPointOnSegment(t, e, i, !0))
          }, closestPointOnSegment: function (t, e, i) {
            return this._sqClosestPointOnSegment(t, e, i)
          }, _simplifyDP: function (t, e) {
            var i = t.length, o = typeof Uint8Array != n + "" ? Uint8Array : Array, r = new o(i);
            r[0] = r[i - 1] = 1, this._simplifyDPStep(t, r, e, 0, i - 1);
            var s, a = [];
            for (s = 0; s < i; s++)r[s] && a.push(t[s]);
            return a
          }, _simplifyDPStep: function (t, e, i, n, o) {
            var r, s, a, h = 0;
            for (s = n + 1; s <= o - 1; s++)a = this._sqClosestPointOnSegment(t[s], t[n], t[o], !0), a > h && (r = s, h = a);
            h > i && (e[r] = 1, this._simplifyDPStep(t, e, i, n, r), this._simplifyDPStep(t, e, i, r, o))
          }, _reducePoints: function (t, e) {
            for (var i = [t[0]], n = 1, o = 0,
                   r = t.length; n < r; n++)this._sqDist(t[n], t[o]) > e && (i.push(t[n]), o = n);
            return o < r - 1 && i.push(t[r - 1]), i
          }, clipSegment: function (t, e, i, n) {
            var o, r, s, a = n ? this._lastCode : this._getBitCode(t, i), h = this._getBitCode(e, i);
            for (this._lastCode = h; ;) {
              if (!(a | h))return [t, e];
              if (a & h)return !1;
              o = a || h, r = this._getEdgeIntersection(t, e, o, i), s = this._getBitCode(r, i), o === a ? (t = r, a = s) : (e = r, h = s)
            }
          }, _getEdgeIntersection: function (t, e, i, n) {
            var o = e.x - t.x, s = e.y - t.y, a = n.min, h = n.max;
            return 8 & i ? new r.Point(t.x + o * (h.y - t.y) / s, h.y) : 4 & i ? new r.Point(t.x + o * (a.y - t.y) / s, a.y) : 2 & i ? new r.Point(h.x, t.y + s * (h.x - t.x) / o) : 1 & i ? new r.Point(a.x, t.y + s * (a.x - t.x) / o) : void 0
          }, _getBitCode: function (t, e) {
            var i = 0;
            return t.x < e.min.x ? i |= 1 : t.x > e.max.x && (i |= 2), t.y < e.min.y ? i |= 4 : t.y > e.max.y && (i |= 8), i
          }, _sqDist: function (t, e) {
            var i = e.x - t.x, n = e.y - t.y;
            return i * i + n * n
          }, _sqClosestPointOnSegment: function (t, e, i, n) {
            var o, s = e.x, a = e.y, h = i.x - s, l = i.y - a, u = h * h + l * l;
            return u > 0 && (o = ((t.x - s) * h + (t.y - a) * l) / u, o > 1 ? (s = i.x, a = i.y) : o > 0 && (s += h * o, a += l * o)), h = t.x - s, l = t.y - a, n ? h * h + l * l : new r.Point(s, a)
          }
        }, r.Polyline = r.Path.extend({
          initialize: function (t, e) {
            r.Path.prototype.initialize.call(this, e), this._latlngs = this._convertLatLngs(t)
          }, options: {smoothFactor: 1, noClip: !1}, projectLatlngs: function () {
            this._originalPoints = [];
            for (var t = 0,
                   e = this._latlngs.length; t < e; t++)this._originalPoints[t] = this._map.latLngToLayerPoint(this._latlngs[t])
          }, getPathString: function () {
            for (var t = 0, e = this._parts.length, i = ""; t < e; t++)i += this._getPathPartStr(this._parts[t]);
            return i
          }, getLatLngs: function () {
            return this._latlngs
          }, setLatLngs: function (t) {
            return this._latlngs = this._convertLatLngs(t), this.redraw()
          }, addLatLng: function (t) {
            return this._latlngs.push(r.latLng(t)), this.redraw()
          }, spliceLatLngs: function () {
            var t = [].splice.apply(this._latlngs, arguments);
            return this._convertLatLngs(this._latlngs, !0), this.redraw(), t
          }, closestLayerPoint: function (t) {
            for (var e, i, n = 1 / 0, o = this._parts, s = null, a = 0, h = o.length; a < h; a++)for (var l = o[a],
                                                                                                        u = 1,
                                                                                                        c = l.length; u < c; u++) {
              e = l[u - 1], i = l[u];
              var p = r.LineUtil._sqClosestPointOnSegment(t, e, i, !0);
              p < n && (n = p, s = r.LineUtil._sqClosestPointOnSegment(t, e, i))
            }
            return s && (s.distance = Math.sqrt(n)), s
          }, getBounds: function () {
            return new r.LatLngBounds(this.getLatLngs())
          }, _convertLatLngs: function (t, e) {
            var i, n, o = e ? t : [];
            for (i = 0, n = t.length; i < n; i++) {
              if (r.Util.isArray(t[i]) && "number" != typeof t[i][0])return;
              o[i] = r.latLng(t[i])
            }
            return o
          }, _initEvents: function () {
            // 只有area及Frame图层触发
            r.Path.prototype._initEvents.call(this)
          }, _getPathPartStr: function (t) {
            for (var e, i = r.Path.VML, n = 0, o = t.length,
                   s = ""; n < o; n++)e = t[n], i && e._round(), s += (n ? "L" : "M") + e.x + " " + e.y;
            return s
          }, _clipPoints: function () {
            var t, e, i, n = this._originalPoints, o = n.length;
            if (this.options.noClip)return void(this._parts = [n]);
            this._parts = [];
            var s = this._parts, a = this._map._pathViewport, h = r.LineUtil;
            for (t = 0, e = 0; t < o - 1; t++)i = h.clipSegment(n[t], n[t + 1], a, t), i && (s[e] = s[e] || [], s[e].push(i[0]), i[1] === n[t + 1] && t !== o - 2 || (s[e].push(i[1]), e++))
          }, _simplifyPoints: function () {
            for (var t = this._parts, e = r.LineUtil, i = 0,
                   n = t.length; i < n; i++)t[i] = e.simplify(t[i], this.options.smoothFactor)
          }, _updatePath: function () {
            this._map && (this._clipPoints(), this._simplifyPoints(), r.Path.prototype._updatePath.call(this))
          }
        }), r.polyline = function (t, e) {
          return new r.Polyline(t, e)
        }, r.PolyUtil = {}, r.PolyUtil.clipPolygon = function (t, e) {
          var i, n, o, s, a, h, l, u, c, p = [1, 4, 2, 8], d = r.LineUtil;
          for (n = 0, l = t.length; n < l; n++)t[n]._code = d._getBitCode(t[n], e);
          for (s = 0; s < 4; s++) {
            for (u = p[s], i = [], n = 0, l = t.length, o = l - 1; n < l; o = n++)a = t[n], h = t[o], a._code & u ? h._code & u || (c = d._getEdgeIntersection(h, a, u, e), c._code = d._getBitCode(c, e), i.push(c)) : (h._code & u && (c = d._getEdgeIntersection(h, a, u, e), c._code = d._getBitCode(c, e), i.push(c)), i.push(a));
            t = i
          }
          return t
        }, r.PolyUtil.getCentroid = function (t) {
          function e(t, e, o, r) {
            var l = r ? 1 : -1, u = n(t, e, o);
            i(t, e, o, s), h.x += l * u * s.x, h.y += l * u * s.y, a += l * u
          }

          function i(t, e, i, n) {
            n.x = t.x + e.x + i.x, n.y = t.y + e.y + i.y
          }

          function n(t, e, i) {
            return (e.x - t.x) * (i.y - t.y) - (i.x - t.x) * (e.y - t.y)
          }

          if (!(t instanceof r.Polygon) || 0 === t._latlngs.length)throw new Error("Invalid polygon");
          var o = null, s = r.point(0, 0), a = 0, h = r.point(0, 0), l = [], u = [], c = null, p = null,
            d = r.point(0, 0), f = 0, _ = 0, m = 0, g = 0;
          for (m = t._latlngs.length, f = 0; f < m; ++f)l[f] = r.CRS.EPSG3857.project(t._latlngs[f]);
          for (m = t._holes.length, f = 0; f < m; ++f) {
            for (c = [], g = t._holes[f].length, _ = 0; _ < g; ++_)c[_] = r.CRS.EPSG3857.project(t._holes[f][_]);
            u.push(c)
          }
          for (o = l[0], p = !r.PolyUtil.isCCW(l), g = l.length - 1, f = 0; f < g; ++f)e(o, l[f], l[f + 1], p);
          for (m = u.length, f = 0; f < m; ++f)for (p = r.PolyUtil.isCCW(l), g = u[f].length - 1, _ = 0; _ < g; ++_)e(o, u[f][_], u[f][_ + 1], p);
          return d.x = h.x / 3 / a, d.y = h.y / 3 / a, r.CRS.EPSG3857.unproject(d)
        }, r.PolyUtil.isCCW = function (t) {
          if (!Array.isArray(t) || t.length < 3)throw new Error("Ring has fewer than 3 points, so orientation cannot be determined");
          var e = t.length - 1, i = t[0], n = 0, o = 0, s = 0, a = null, h = null, l = null, u = 0, c = !1, p = 0,
            d = 0, f = 0, _ = 0, m = 0;
          for (p = 1; p <= e; ++p)l = t[p], l.y > i.y && (i = l, n = p);
          o = n;
          do o -= 1, o < 0 && (o = e); while (t[o].equals(i) && o !== n);
          s = n;
          do s = (s + 1) % (e + 1), s < 0 && (s = e); while (t[s].equals(i) && s !== n);
          return a = t[o], h = t[s], a.equals(i) || h.equals(i) || a.equals(h) ? (console.warn("degenerate ring (does not contain 3 distinct points)"), !1) : (d = i.x - a.x, f = i.y - a.y, _ = h.x - i.x, m = h.y - i.y, u = r.Algorithm.signOfDet2x2(d, f, _, m), c = 0 === u ? a.x > h.x : u > 0)
        }, r.PolyUtil.linearRingContainsPoint = function (t, e) {
          var i = !1, n = null, o = r.PolyUtil.isCCW(t) ? t.slice().reverse() : t, s = o[o.length - 1], a = null,
            h = null;
          for (h = 0; h < t.length; ++h)a = o[h], n = s.y > e.y != a.y > e.y && e.x < (a.x - s.x) * (e.y - s.y) / (a.y - s.y) + s.x, n && (i = !i), s = a;
          return i
        }, r.PolyUtil.PolygonContainsPoint = function (t, e) {
          if (!(t instanceof r.Polygon) || 0 === t._latlngs.length)throw new Error("Invalid polygon");
          if (!e || !e.x || !e.y)throw new Error("Invalid point");
          var i = [], n = [], o = null, s = 0, a = 0, h = 0, l = 0;
          for (h = t._latlngs.length, s = 0; s < h; ++s)i[s] = r.CRS.EPSG3857.project(t._latlngs[s]);
          for (h = t._holes.length, s = 0; s < h; ++s) {
            for (o = [], l = t._holes[s].length, a = 0; a < l; ++a)o[a] = r.CRS.EPSG3857.project(t._holes[s][a]);
            n.push(o)
          }
          if (!r.PolyUtil.linearRingContainsPoint(i, e))return !1;
          for (h = n.length, s = 0; s < h; ++s)if (r.PolyUtil.linearRingContainsPoint(n[s], e))return !1;
          return !0
        }, r.PolyUtil.PolygonContainsLatLng = function (t, e) {
          if (!r.latLng(e))throw new Error("Invalid latLng");
          return r.PolyUtil.PolygonContainsPoint(t, r.CRS.EPSG3857.project(r.latLng(e)))
        }, r.Polygon = r.Polyline.extend({
          options: {fill: !0}, initialize: function (t, e) {
            r.Polyline.prototype.initialize.call(this, t, e), this._initWithHoles(t), this._innerPointCache = {}, this._zoomSizeCache = {}
          }, _initWithHoles: function (t) {
            var e, i, n;
            if (t && r.Util.isArray(t[0]) && "number" != typeof t[0][0])for (this._latlngs = this._convertLatLngs(t[0]), this._holes = t.slice(1), e = 0, i = this._holes.length; e < i; e++)n = this._holes[e] = this._convertLatLngs(this._holes[e]), n[0].equals(n[n.length - 1]) && n.pop();
            t = this._latlngs, t.length >= 2 && t[0].equals(t[t.length - 1]) && t.pop()
          }, projectLatlngs: function () {
            if (r.Polyline.prototype.projectLatlngs.call(this), this._holePoints = [], this._holes) {
              var t, e, i, n;
              for (t = 0, i = this._holes.length; t < i; t++)for (this._holePoints[t] = [], e = 0, n = this._holes[t].length; e < n; e++)this._holePoints[t][e] = this._map.latLngToLayerPoint(this._holes[t][e])
            }
          }, setLatLngs: function (t) {
            return t && r.Util.isArray(t[0]) && "number" != typeof t[0][0] ? (this._initWithHoles(t), this.redraw()) : r.Polyline.prototype.setLatLngs.call(this, t)
          }, _clipPoints: function () {
            var t = this._originalPoints, e = [];
            if (this._parts = [t].concat(this._holePoints), !this.options.noClip) {
              for (var i = 0, n = this._parts.length; i < n; i++) {
                var o = r.PolyUtil.clipPolygon(this._parts[i], this._map._pathViewport);
                o.length && e.push(o)
              }
              this._parts = e
            }
          }, _getPathPartStr: function (t) {
            var e = r.Polyline.prototype._getPathPartStr.call(this, t);
            return e + (r.Browser.svg ? "z" : "x")
          }, getCentroid: function () {
            if (this._latlngs) {
              var t = this._latlngs.length;
              if (t > 0 && t <= 2)return r.latLng(this._latlngs[0]);
              if (t > 2) {
                var e, i = 0, n = 0, o = 0, s = r.CRS.EPSG3857.project(this._latlngs[0]), a = s.x, h = s.y;
                for (e = 0; e < t; ++e) {
                  var l = r.CRS.EPSG3857.project(this._latlngs[e]),
                    u = r.CRS.EPSG3857.project(this._latlngs[e === t - 1 ? 0 : e + 1]);
                  o += (l.x * u.y - u.x * l.y) / 2
                }
                if (0 != o) {
                  for (e = 0; e < t; ++e) {
                    var l = r.CRS.EPSG3857.project(this._latlngs[e]),
                      u = r.CRS.EPSG3857.project(this._latlngs[e === t - 1 ? 0 : e + 1]),
                      c = (l.x - a) * (u.y - h) - (u.x - a) * (l.y - h);
                    i += (l.x + u.x - 2 * a) * c, n += (l.y + u.y - 2 * h) * c
                  }
                  return r.latLng(r.CRS.EPSG3857.unproject(r.point(a + i / (6 * o), h + n / (6 * o))))
                }
                for (e = 0; e < t - 1; ++e) {
                  var l = r.CRS.EPSG3857.project(this._latlngs[e]);
                  i += l.x, n += l.y
                }
                return r.latLng(r.CRS.EPSG3857.unproject(r.point(i / (t - 1), n / (t - 1))))
              }
              return null
            }
          }, _calcMinPSDistance: function (t, e) {
            for (var i, n = Number.MAX_VALUE,
                   o = 0; o < t.length; ++o)i = r.Algorithm.pointSegmentDistance(t[o], t[(o + 1) % t.length], e), i < n && (n = i);
            return n
          }, _calculateInnerPoint: function (t, e) {
            for (var i = t.length, o = t[e], s = t[(e + 1) % i], a = t[(e + i - 1) % i],
                   h = [e, (e + 1) % i, (e + i - 1) % i], l = [],
                   u = 0; u < i; ++u)h.indexOf(u) >= 0 || r.Algorithm.pointInTriangle(a, o, s, t[u]) && (l[u] = r.Algorithm.pointDistance(o, t[u], !0));
            var c;
            if (0 === l.length) c = r.point((a.x + s.x) / 2, (a.y + s.y) / 2); else {
              for (l.length = i, u = 0; u < i; ++u)l[u] === n && (l[u] = Number.MAX_VALUE);
              var p = t[l.indexOf(Math.min.apply(null, l))];
              c = r.point((o.x + p.x) / 2, (o.y + p.y) / 2)
            }
            return [r.CRS.EPSG3857.unproject(c), this._calcMinPSDistance(t, c)]
          }, getInnerPoint: function (t) {
            if (t || (t = .5), t + "" in this._innerPointCache)return this._innerPointCache[t + ""];
            for (var e = this._latlngs.length, i = [],
                   n = 0; n < e; ++n)i[n] = r.CRS.EPSG3857.project(this._latlngs[n]);
            var o = r.LineUtil.simplify(i, t);
            if (o.length >= 3 && (i = o, e = o.length, this._simplifiedlatlngs = function () {
                for (var t = [], n = 0; n < e; ++n)t[n] = r.CRS.EPSG3857.unproject(i[n]);
                return t
              }()), 3 === e)return this.getCentroid();
            var s = {
              xMin: {index: [0], value: i[0].x},
              xMax: {index: [0], value: i[0].x},
              yMin: {index: [0], value: i[0].y},
              yMax: {index: [0], value: i[0].y}
            };
            for (n = 0; n < e; ++n)i[n].x < s.xMin.value ? s.xMin = {
              index: [n],
              value: i[n].x
            } : i[n].x > s.xMax.value ? s.xMax = {
              index: [n],
              value: i[n].x
            } : i[n].x == s.xMin.value ? s.xMin.index.push(n) : i[n].x == s.xMax.value && s.xMax.index.push(n), i[n].y <= s.yMin.value ? s.yMin = {
              index: [n],
              value: i[n].y
            } : i[n].y >= s.yMax.value ? s.yMax = {
              index: [n],
              value: i[n].y
            } : i[n].y == s.yMin.value ? s.yMin.index.push(n) : i[n].y == s.yMax.value && s.yMax.index.push(n);
            var a = [], h = [];
            for (var l in s)h = h.concat(s[l].index);
            for (; 0 != h.length;) {
              var u = h.pop();
              a.indexOf(u) == -1 && a.push(u)
            }
            var c = null, p = Number.MIN_VALUE;
            for (n = 0; n < a.length; ++n) {
              var d = this._calculateInnerPoint(i, a[n]);
              d[1] > p && (c = d[0], p = d[1])
            }
            return this._innerPointCache[t + ""] = c
          }, _getSimplifiedLatlngs: function () {
            return this._simplifiedlatlngs || this._latlngs
          }, _getSimplifiedPolygon: function (t) {
            return r.polygon(this._getSimplifiedLatlngs(), t)
          }, getSize: function () {
            if (this._map)return 0 == this._originalPoints.length ? null : this._map.getZoom() in this._zoomSizeCache ? this._zoomSizeCache[this._map.getZoom()] : this._zoomSizeCache[this._map.getZoom()] = r.bounds.call(null, this._originalPoints).getSize()
          }
        }), r.polygon = function (t, e) {
          return new r.Polygon(t, e)
        }, function () {
          function t(t) {
            return r.FeatureGroup.extend({
              initialize: function (t, e) {
                this._layers = {}, this._options = e, this.setLatLngs(t)
              }, setLatLngs: function (e) {
                var i = 0, n = e.length;
                for (this.eachLayer(function (t) {
                  i < n ? t.setLatLngs(e[i++]) : this.removeLayer(t)
                }, this); i < n;)this.addLayer(new t(e[i++], this._options));
                return this
              }, getLatLngs: function () {
                var t = [];
                return this.eachLayer(function (e) {
                  t.push(e.getLatLngs())
                }), t
              }
            })
          }

          r.MultiPolyline = t(r.Polyline), r.MultiPolygon = t(r.Polygon), r.multiPolyline = function (t, e) {
            return new r.MultiPolyline(t, e)
          }, r.multiPolygon = function (t, e) {
            return new r.MultiPolygon(t, e)
          }
        }(),r.Rectangle = r.Polygon.extend({
          initialize: function (t, e) {
            r.Polygon.prototype.initialize.call(this, this._boundsToLatLngs(t), e)
          }, setBounds: function (t) {
            this.setLatLngs(this._boundsToLatLngs(t))
          }, _boundsToLatLngs: function (t) {
            return t = r.latLngBounds(t), [t.getSouthWest(), t.getNorthWest(), t.getNorthEast(), t.getSouthEast()]
          }
        }),r.rectangle = function (t, e) {
          return new r.Rectangle(t, e)
        },r.Circle = r.Path.extend({
          initialize: function (t, e, i) {
            r.Path.prototype.initialize.call(this, i), this._latlng = r.latLng(t), this._mRadius = e
          }, options: {fill: !0}, setLatLng: function (t) {
            return this._latlng = r.latLng(t), this.redraw()
          }, setRadius: function (t) {
            return this._mRadius = t, this.redraw()
          }, projectLatlngs: function () {
            var t = this._getLngRadius(), e = this._latlng, i = this._map.latLngToLayerPoint([e.lat, e.lng - t]);
            this._point = this._map.latLngToLayerPoint(e), this._radius = Math.max(this._point.x - i.x, 1)
          }, getBounds: function () {
            var t = this._getLngRadius(), e = this._mRadius / 40075017 * 360, i = this._latlng;
            return new r.LatLngBounds([i.lat - e, i.lng - t], [i.lat + e, i.lng + t])
          }, getLatLng: function () {
            return this._latlng
          }, getPathString: function () {
            var t = this._point, e = this._radius;
            return this._checkIfEmpty() ? "" : r.Browser.svg ? "M" + t.x + "," + (t.y - e) + "A" + e + "," + e + ",0,1,1," + (t.x - .1) + "," + (t.y - e) + " z" : (t._round(), e = Math.round(e), "AL " + t.x + "," + t.y + " " + e + "," + e + " 0,23592600")
          }, getRadius: function () {
            return this._mRadius
          }, _getLatRadius: function () {
            return this._mRadius / 40075017 * 360
          }, _getLngRadius: function () {
            return this._getLatRadius() / Math.cos(r.LatLng.DEG_TO_RAD * this._latlng.lat)
          }, _checkIfEmpty: function () {
            if (!this._map)return !1;
            var t = this._map._pathViewport, e = this._radius, i = this._point;
            return i.x - e > t.max.x || i.y - e > t.max.y || i.x + e < t.min.x || i.y + e < t.min.y
          }
        }),r.circle = function (t, e, i) {
          return new r.Circle(t, e, i)
        },r.CircleMarker = r.Circle.extend({
          options: {radius: 10, weight: 2}, initialize: function (t, e) {
            r.Circle.prototype.initialize.call(this, t, null, e), this._radius = this.options.radius
          }, projectLatlngs: function () {
            this._point = this._map.latLngToLayerPoint(this._latlng)
          }, _updateStyle: function () {
            r.Circle.prototype._updateStyle.call(this), this.setRadius(this.options.radius)
          }, setLatLng: function (t) {
            return r.Circle.prototype.setLatLng.call(this, t), this._popup && this._popup._isOpen && this._popup.setLatLng(t), this
          }, setRadius: function (t) {
            return this.options.radius = this._radius = t, this.redraw()
          }, getRadius: function () {
            return this._radius
          }
        }),r.circleMarker = function (t, e) {
          return new r.CircleMarker(t, e)
        },r.Polyline.include(r.Path.CANVAS ? {
          _containsPoint: function (t, e) {
            var i, n, o, s, a, h, l, u = this.options.weight / 2;
            for (r.Browser.touch && (u += 10), i = 0, s = this._parts.length; i < s; i++)for (l = this._parts[i], n = 0, a = l.length, o = a - 1; n < a; o = n++)if ((e || 0 !== n) && (h = r.LineUtil.pointToSegmentDistance(t, l[o], l[n]), h <= u))return !0;
            return !1
          }
        } : {}),r.Polygon.include(r.Path.CANVAS ? {
          _containsPoint: function (t) {
            var e, i, n, o, s, a, h, l, u = !1;
            if (r.Polyline.prototype._containsPoint.call(this, t, !0))return !0;
            for (o = 0, h = this._parts.length; o < h; o++)for (e = this._parts[o], s = 0, l = e.length, a = l - 1; s < l; a = s++)i = e[s], n = e[a], i.y > t.y != n.y > t.y && t.x < (n.x - i.x) * (t.y - i.y) / (n.y - i.y) + i.x && (u = !u);
            return u
          }, _updateStyle: function () {
            this._updateStrokeStyle(), this._updateFillStyle()
          }, _updateStrokeStyle: function () {
            var t = this.options;
            t.stroke && (this._ctx.lineWidth = t.weight, this._ctx.strokeStyle = t.color, t.lineCap && (this._ctx.lineCap = t.lineCap), t.lineJoin && (this._ctx.lineJoin = t.lineJoin), t.dashArray && this._ctx.setLineDash(t.dashArray))
          }, _updateFillStyle: function () {
            var t = this.options;
            if (t.texture) {
              var e = r.point([this._map.latLngToLayerPoint(this.getBounds()._southWest).x, this._map.latLngToLayerPoint(this.getBounds()._northEast).y]);
              if (this._ctx.translate(e.x, e.y), !this._pattern) {
                var i = t.textureSize[0] + t.textureSize[1];
                if (t.texture + i in NGR.Cache._patternCache) this._pattern = NGR.Cache._patternCache[t.texture + i], this._scaleFlag = NGR.Cache._patternCache[t.texture + i].scaleFlag; else {
                  if (!(t.texture in NGR.Cache._imageCache && this._map._fixedPointOnMap))return void(this._ctx.fillStyle = t.fillColor || t.color);
                  this._pattern = this._map._canvasCtx.createPattern(this.preparePattern(t.texture), t.textureRepeat ? t.textureRepeat : "repeat"), NGR.Cache._patternCache[t.texture + i] = this._pattern, NGR.Cache._patternCache[t.texture + i].scaleFlag = this._scaleFlag
                }
              }
              if (this._scaleFlag && this._map.zoomDelta && this._map.zoomDelta !== this._map.getZoom()) {
                var n = Math.pow(2, this._map.zoomDelta);
                this._ctx.scale(n, n)
              }
              t.textureRotate && this._ctx.rotate(t.textureRotate), this._ctx.fillStyle = this._pattern
            } else t.fill && (this._ctx.fillStyle = t.fillColor || t.color)
          }, _updatePath: function () {
            if (this._map && (this._clipPoints(), this._simplifyPoints(), !this._checkIfEmpty())) {
              var t = this._ctx, e = this.options;
              this._drawPath(), t.save(), this._updateFillStyle(), e.fill && (t.globalAlpha = e.fillOpacity, t.fill()), t.restore(), t.save(), this._updateStrokeStyle(), e.stroke && (t.globalAlpha = e.opacity, t.stroke()), t.restore()
            }
          }, preparePattern: function (t) {
            var e = this, n = this.options, o = function (t) {
              var e = /^(\d+|\d*\.\d+)\s*(m|px)?$/i.exec(t);
              return 3 === e.length ? {
                value: parseFloat(e[1]),
                unit: e[2] ? e[2] : "px"
              } : void console.error('Wrong syntax "' + t + '" in fixedSize.')
            }, s = function (t, i) {
              var n, o, s, a = r.point(0, 0);
              switch (t.unit + " " + i.unit) {
                case"m m":
                  n = e._map.latLngToPreciseContainerPoint(e._map._fixedPointOnMap), o = e._map.latLngToPreciseContainerPoint(e._map._fixedPointOnMapOffsetOneMeter), s = Math.abs(n.x - o.x), s < 1 && (s = 1), e._scaleFlag = !0, a.x = s * t.value, a.y = s * i.value;
                  break;
                case"px px":
                  e._scaleFlag = !1, a.x = t.value, a.y = t.value;
                  break;
                default:
                  return console.warn("Unsupported unit combination", t.unit + "+" + i.unit), null
              }
              return a
            }, a = function (e) {
              if (t in NGR.Cache._imageCache) {
                var n = i.createElement("canvas");
                return n.width = e.x, n.height = e.y, n.getContext("2d").drawImage(NGR.Cache._imageCache[t], 0, 0, e.x, e.y), n
              }
            }, h = s(o(n.textureSize[0]), o(n.textureSize[1]));
            return a(h)
          }
        } : {}),r.Circle.include(r.Path.CANVAS ? {
          _drawPath: function () {
            var t = this._point;
            this._ctx.beginPath(), this._ctx.arc(t.x, t.y, this._radius, 0, 2 * Math.PI, !1)
          }, _containsPoint: function (t) {
            var e = this._point, i = this.options.stroke ? this.options.weight / 2 : 0;
            return t.distanceTo(e) <= this._radius + i
          }
        } : {}),r.CircleMarker.include(r.Path.CANVAS ? {
          _updateStyle: function () {
            r.Path.prototype._updateStyle.call(this)
          }
        } : {}),r.GeoJSON = r.FeatureGroup.extend({
          initialize: function (t, e) {
            r.setOptions(this, e), this._layers = {}, t && this.addData(t)
          }, addData: function (t) {
            var e, i, n, o = r.Util.isArray(t) ? t : t.features;
            if (o) {
              for (e = 0, i = o.length; e < i; e++)n = o[e], (n.geometries || n.geometry || n.features || n.coordinates) && this.addData(o[e]);
              return this
            }
            var s = this.options;
            if (!s.filter || s.filter(t)) {
              var a = r.GeoJSON.geometryToLayer(t, s.pointToLayer, s.coordsToLatLng, s);
              return a.feature = r.GeoJSON.asFeature(t), a.defaultOptions = a.options, this.resetStyle(a), s.onEachFeature && s.onEachFeature(t, a), this.addLayer(a)
            }
          }, resetStyle: function (t) {
            var e = this.options.style;
            e && (r.Util.extend(t.options, t.defaultOptions), this._setLayerStyle(t, e))
          }, setStyle: function (t) {
            this.eachLayer(function (e) {
              this._setLayerStyle(e, t)
            }, this)
          }, _setLayerStyle: function (t, e) {
            "function" == typeof e && (e = e(t.feature)), t.setStyle && t.setStyle(e)
          }
        }),r.extend(r.GeoJSON, {
          geometryToLayer: function (t, e, i, n) {
            var o, s, a, h, l = "Feature" === t.type ? t.geometry : t, u = l.coordinates, c = [];
            switch (i = i || this.coordsToLatLng, l.type) {
              case"Point":
                return o = i(u), e ? e(t, o) : new r.Marker(o);
              case"MultiPoint":
                for (a = 0, h = u.length; a < h; a++)o = i(u[a]), c.push(e ? e(t, o) : new r.Marker(o));
                return new r.FeatureGroup(c);
              case"LineString":
                return s = this.coordsToLatLngs(u, 0, i), new r.Polyline(s, n);
              case"Polygon":
                if (2 === u.length && !u[1].length)throw new Error("Invalid GeoJSON object.");
                return s = this.coordsToLatLngs(u, 1, i), new r.Polygon(s, n);
              case"MultiLineString":
                return s = this.coordsToLatLngs(u, 1, i), new r.MultiPolyline(s, n);
              case"MultiPolygon":
                return s = this.coordsToLatLngs(u, 2, i), new r.MultiPolygon(s, n);
              case"GeometryCollection":
                for (a = 0, h = l.geometries.length; a < h; a++)c.push(this.geometryToLayer({
                  geometry: l.geometries[a],
                  type: "Feature",
                  properties: t.properties
                }, e, i, n));
                return new r.FeatureGroup(c);
              default:
                throw new Error("Invalid GeoJSON object.")
            }
          }, coordsToLatLng: function (t) {
            return new r.LatLng(t[1], t[0], t[2])
          }, coordsToLatLngs: function (t, e, i) {
            var n, o, r, s = [];
            for (o = 0, r = t.length; o < r; o++)n = e ? this.coordsToLatLngs(t[o], e - 1, i) : (i || this.coordsToLatLng)(t[o]), s.push(n);
            return s
          }, latLngToCoords: function (t) {
            var e = [t.lng, t.lat];
            return t.alt !== n && e.push(t.alt), e
          }, latLngsToCoords: function (t) {
            for (var e = [], i = 0, n = t.length; i < n; i++)e.push(r.GeoJSON.latLngToCoords(t[i]));
            return e
          }, getFeature: function (t, e) {
            return t.feature ? r.extend({}, t.feature, {geometry: e}) : r.GeoJSON.asFeature(e)
          }, asFeature: function (t) {
            return "Feature" === t.type ? t : {type: "Feature", properties: {}, geometry: t}
          }
        });
        var a = {
          toGeoJSON: function () {
            return r.GeoJSON.getFeature(this, {
              type: "Point",
              coordinates: r.GeoJSON.latLngToCoords(this.getLatLng())
            })
          }
        };
        r.Marker.include(a), r.Circle.include(a), r.CircleMarker.include(a), r.Polyline.include({
          toGeoJSON: function () {
            return r.GeoJSON.getFeature(this, {
              type: "LineString",
              coordinates: r.GeoJSON.latLngsToCoords(this.getLatLngs())
            })
          }
        }), r.Polygon.include({
          toGeoJSON: function () {
            var t, e, i, n = [r.GeoJSON.latLngsToCoords(this.getLatLngs())];
            if (n[0].push(n[0][0]), this._holes)for (t = 0, e = this._holes.length; t < e; t++)i = r.GeoJSON.latLngsToCoords(this._holes[t]), i.push(i[0]), n.push(i);
            return r.GeoJSON.getFeature(this, {type: "Polygon", coordinates: n})
          }
        }), function () {
          function t(t) {
            return function () {
              var e = [];
              return this.eachLayer(function (t) {
                e.push(t.toGeoJSON().geometry.coordinates)
              }), r.GeoJSON.getFeature(this, {type: t, coordinates: e})
            }
          }

          r.MultiPolyline.include({toGeoJSON: t("MultiLineString")}), r.MultiPolygon.include({toGeoJSON: t("MultiPolygon")}), r.LayerGroup.include({
            toGeoJSON: function () {
              var e, i = this.feature && this.feature.geometry, n = [];
              if (i && "MultiPoint" === i.type)return t("MultiPoint").call(this);
              var o = i && "GeometryCollection" === i.type;
              return this.eachLayer(function (t) {
                t.toGeoJSON && (e = t.toGeoJSON(), n.push(o ? e.geometry : r.GeoJSON.asFeature(e)))
              }), o ? r.GeoJSON.getFeature(this, {
                geometries: n,
                type: "GeometryCollection"
              }) : {type: "FeatureCollection", features: n}
            }
          })
        }(), r.geoJson = function (t, e) {
          return new r.GeoJSON(t, e)
        }, r.DomEvent = {
          addListener: function (t, e, i, n) {
            var o, s, a, h = r.stamp(i), l = "_ngr_" + e + h;
            return t[l] ? this : (o = function (e) {
              return i.call(n || t, e || r.DomEvent._getEvent())
            }, r.Browser.pointer && 0 === e.indexOf("touch") ? this.addPointerListener(t, e, o, h) : (r.Browser.touch && "dblclick" === e && this.addDoubleTapListener && this.addDoubleTapListener(t, o, h), "addEventListener" in t ? "mousewheel" === e ? (t.addEventListener("DOMMouseScroll", o, !1), t.addEventListener(e, o, !1)) : "mouseenter" === e || "mouseleave" === e ? (s = o, a = "mouseenter" === e ? "mouseover" : "mouseout", o = function (e) {
              if (r.DomEvent._checkMouse(t, e))return s(e)
            }, t.addEventListener(a, o, !1)) : "click" === e && r.Browser.android ? (s = o, o = function (t) {
              return r.DomEvent._filterClick(t, s)
            }, t.addEventListener(e, o, !1)) : t.addEventListener(e, o, !1) : "attachEvent" in t && t.attachEvent("on" + e, o), t[l] = o, this))
          }, removeListener: function (t, e, i) {
            var n = r.stamp(i), o = "_ngr_" + e + n, s = t[o];
            return s ? (r.Browser.pointer && 0 === e.indexOf("touch") ? this.removePointerListener(t, e, n) : r.Browser.touch && "dblclick" === e && this.removeDoubleTapListener ? this.removeDoubleTapListener(t, n) : "removeEventListener" in t ? "mousewheel" === e ? (t.removeEventListener("DOMMouseScroll", s, !1), t.removeEventListener(e, s, !1)) : "mouseenter" === e || "mouseleave" === e ? t.removeEventListener("mouseenter" === e ? "mouseover" : "mouseout", s, !1) : t.removeEventListener(e, s, !1) : "detachEvent" in t && t.detachEvent("on" + e, s), t[o] = null, this) : this
          }, stopPropagation: function (t) {
            return t.stopPropagation ? t.stopPropagation() : t.cancelBubble = !0, r.DomEvent._skipped(t), this
          }, disableScrollPropagation: function (t) {
            var e = r.DomEvent.stopPropagation;
            return r.DomEvent.on(t, "mousewheel", e).on(t, "MozMousePixelScroll", e)
          }, disableClickPropagation: function (t) {
            for (var e = r.DomEvent.stopPropagation,
                   i = r.Draggable.START.length - 1; i >= 0; i--)r.DomEvent.on(t, r.Draggable.START[i], e);
            return r.DomEvent.on(t, "click", r.DomEvent._fakeStop).on(t, "dblclick", e)
          }, preventDefault: function (t) {
            return t.preventDefault ? t.preventDefault() : t.returnValue = !1, this
          }, stop: function (t) {
            return r.DomEvent.preventDefault(t).stopPropagation(t)
          }, getMousePosition: function (t, e) {
            if (!e)return new r.Point(t.clientX, t.clientY);
            var i = e.getBoundingClientRect();
            return new r.Point(t.clientX - i.left - e.clientLeft, t.clientY - i.top - e.clientTop)
          }, getWheelDelta: function (t) {
            var e = 0;
            return t.wheelDelta && (e = t.wheelDelta / 120), t.detail && (e = -t.detail / 3), e
          }, _skipEvents: {}, _fakeStop: function (t) {
            r.DomEvent._skipEvents[t.type] = !0
          }, _skipped: function (t) {
            var e = this._skipEvents[t.type];
            return this._skipEvents[t.type] = !1, e
          }, _checkMouse: function (t, e) {
            var i = e.relatedTarget;
            if (!i)return !0;
            try {
              for (; i && i !== t;)i = i.parentNode
            } catch (n) {
              return !1
            }
            return i !== t
          }, _getEvent: function () {
            var e = t.event;
            if (!e)for (var i = arguments.callee.caller; i && (e = i.arguments[0], !e || t.Event !== e.constructor);)i = i.caller;
            return e
          }, _filterClick: function (t, e) {
            var i = t.timeStamp || t.originalEvent.timeStamp, n = r.DomEvent._lastClick && i - r.DomEvent._lastClick;
            return n && n > 100 && n < 500 || t.target._simulatedClick && !t._simulated ? void r.DomEvent.stop(t) : (r.DomEvent._lastClick = i, e(t))
          }
        }, r.DomEvent.on = r.DomEvent.addListener, r.DomEvent.off = r.DomEvent.removeListener, r.Draggable = r.Class.extend({
          includes: r.Mixin.Events,
          statics: {
            START: r.Browser.touch ? ["touchstart", "mousedown"] : ["mousedown"],
            END: {
              mousedown: "mouseup",
              touchstart: "touchend",
              pointerdown: "touchend",
              MSPointerDown: "touchend"
            },
            MOVE: {
              mousedown: "mousemove",
              touchstart: "touchmove",
              pointerdown: "touchmove",
              MSPointerDown: "touchmove"
            }
          },
          initialize: function (t, e) {
            this._element = t, this._dragStartTarget = e || t
          },
          enable: function () {
            if (!this._enabled) {
              for (var t = r.Draggable.START.length - 1; t >= 0; t--)r.DomEvent.on(this._dragStartTarget, r.Draggable.START[t], this._onDown, this);
              this._enabled = !0
            }
          },
          disable: function () {
            if (this._enabled) {
              for (var t = r.Draggable.START.length - 1; t >= 0; t--)r.DomEvent.off(this._dragStartTarget, r.Draggable.START[t], this._onDown, this);
              this._enabled = !1, this._moved = !1
            }
          },
          _onDown: function (t) {
            if (this._moved = !1, !t.shiftKey && (1 === t.which || 1 === t.button || t.touches) && (r.DomEvent.stopPropagation(t), !r.Draggable._disabled && (r.DomUtil.disableImageDrag(), r.DomUtil.disableTextSelection(), !this._moving))) {
              var e = t.touches ? t.touches[0] : t;
              this._startPoint = new r.Point(e.clientX, e.clientY), this._startPos = this._newPos = r.DomUtil.getPosition(this._element), r.DomEvent.on(i, r.Draggable.MOVE[t.type], this._onMove, this).on(i, r.Draggable.END[t.type], this._onUp, this)
            }
          },
          _onMove: function (t) {
            if (t.touches && t.touches.length > 1)return void(this._moved = !0);
            var e = t.touches && 1 === t.touches.length ? t.touches[0] : t, n = new r.Point(e.clientX, e.clientY),
              o = n.subtract(this._startPoint);
            (o.x || o.y) && (r.Browser.touch && Math.abs(o.x) + Math.abs(o.y) < 3 || (r.DomEvent.preventDefault(t), this._moved || (this.fire("dragstart"), this._moved = !0, this._startPos = r.DomUtil.getPosition(this._element).subtract(o), r.DomUtil.addClass(i.body, "ngr-dragging"), this._lastTarget = t.target || t.srcElement, r.DomUtil.addClass(this._lastTarget, "ngr-drag-target")), this._newPos = this._startPos.add(o), this._moving = !0, r.Util.cancelAnimFrame(this._animRequest), this._animRequest = r.Util.requestAnimFrame(this._updatePosition, this, !0, this._dragStartTarget)))
          },
          _updatePosition: function () {
            this.fire("predrag"), r.DomUtil.setPosition(this._element, this._newPos), this.fire("drag")
          },
          _onUp: function () {
            r.DomUtil.removeClass(i.body, "ngr-dragging"), this._lastTarget && (r.DomUtil.removeClass(this._lastTarget, "ngr-drag-target"), this._lastTarget = null);
            for (var t in r.Draggable.MOVE)r.DomEvent.off(i, r.Draggable.MOVE[t], this._onMove).off(i, r.Draggable.END[t], this._onUp);
            r.DomUtil.enableImageDrag(), r.DomUtil.enableTextSelection(), this._moved && this._moving && (r.Util.cancelAnimFrame(this._animRequest), this.fire("dragend", {distance: this._newPos.distanceTo(this._startPos)})), this._moving = !1
          }
        }), r.Handler = r.Class.extend({
          initialize: function (t) {
            this._map = t
          }, enable: function () {
            this._enabled || (this._enabled = !0, this.addHooks())
          }, disable: function () {
            this._enabled && (this._enabled = !1, this.removeHooks())
          }, enabled: function () {
            return !!this._enabled
          }
        }), r.Map.mergeOptions({
          dragging: !0,
          inertia: !r.Browser.android23,
          inertiaDeceleration: 3400,
          inertiaMaxSpeed: 1 / 0,
          inertiaThreshold: r.Browser.touch ? 32 : 18,
          easeLinearity: .25,
          worldCopyJump: !1
        }), r.Map.Drag = r.Handler.extend({
          addHooks: function () {
            if (!this._draggable) {
              var t = this._map;
              this._draggable = new r.Draggable(t._mapPane, t._container), this._draggable.on({
                dragstart: this._onDragStart,
                drag: this._onDrag,
                dragend: this._onDragEnd
              }, this), t.options.worldCopyJump && (this._draggable.on("predrag", this._onPreDrag, this), t.on("viewreset", this._onViewReset, this), t.whenReady(this._onViewReset, this))
            }
            this._draggable.enable()
          }, removeHooks: function () {
            this._draggable.disable()
          }, moved: function () {
            return this._draggable && this._draggable._moved
          }, _onDragStart: function () {
            var t = this._map;
            t._panAnim && t._panAnim.stop(), t.fire("movestart").fire("dragstart"), t.options.inertia && (this._positions = [], this._times = [])
          }, _onDrag: function () {
            if (this._map.options.inertia) {
              var t = this._lastTime = +new Date, e = this._lastPos = this._draggable._newPos;
              this._positions.push(e), this._times.push(t), t - this._times[0] > 200 && (this._positions.shift(), this._times.shift()), r.Browser.mobile && Object.keys(NGR.Cache._imageCache).length > 0 && this._map._delayId && (clearTimeout(this._map._delayId), this._map._delayId = null)
            }
            this._map.fire("move").fire("drag")
          }, _onViewReset: function () {
            var t = this._map.getSize()._divideBy(2), e = this._map.latLngToLayerPoint([0, 0]);
            this._initialWorldOffset = e.subtract(t).x, this._worldWidth = this._map.project([0, 180]).x
          }, _onPreDrag: function () {
            var t = this._worldWidth, e = Math.round(t / 2), i = this._initialWorldOffset,
              n = this._draggable._newPos.x, o = (n - e + i) % t + e - i, r = (n + e + i) % t - e - i,
              s = Math.abs(o + i) < Math.abs(r + i) ? o : r;
            this._draggable._newPos.x = s
          }, _onDragEnd: function (t) {
            var e = this._map, i = e.options, n = +new Date - this._lastTime,
              o = !i.inertia || n > i.inertiaThreshold || !this._positions[0];
            if (e.fire("dragend", t), o) r.Browser.mobile && Object.keys(NGR.Cache._imageCache).length > 0 ? e._delayId || (e._delayId = setTimeout(function () {
                e._delayId = null, e.fire("moveend")
              }.bind(this), 500)) : e.fire("moveend"); else {
              var s = this._lastPos.subtract(this._positions[0]), a = (this._lastTime + n - this._times[0]) / 1e3,
                h = i.easeLinearity, l = s.multiplyBy(h / a), u = l.distanceTo([0, 0]),
                c = Math.min(i.inertiaMaxSpeed, u), p = l.multiplyBy(c / u), d = c / (i.inertiaDeceleration * h),
                f = p.multiplyBy(-d / 2).round();
              f.x && f.y ? (f = e._limitOffset(f, e.options.maxBounds), r.Util.requestAnimFrame(function () {
                e.panBy(f, {duration: d, easeLinearity: h, noMoveStart: !0})
              })) : r.Browser.mobile && Object.keys(NGR.Cache._imageCache).length > 0 ? e._delayId || (e._delayId = setTimeout(function () {
                  e._delayId = null, e.fire("moveend")
                }.bind(this), 500)) : e.fire("moveend")
            }
          }
        }), r.Map.addInitHook("addHandler", "dragging", r.Map.Drag), r.Map.mergeOptions({doubleClickZoom: !0}), r.Map.DoubleClickZoom = r.Handler.extend({
          addHooks: function () {
            this._map.on("dblclick", this._onDoubleClick, this)
          }, removeHooks: function () {
            this._map.off("dblclick", this._onDoubleClick, this)
          }, _onDoubleClick: function (t) {
            var e = this._map, i = e.getZoom() + (t.originalEvent.shiftKey ? -1 : 1);
            "center" === e.options.doubleClickZoom ? e.setZoom(i) : e.setZoomAround(t.containerPoint, i)
          }
        }), r.Map.addInitHook("addHandler", "doubleClickZoom", r.Map.DoubleClickZoom), r.Map.mergeOptions({scrollWheelZoom: !0}), r.Map.ScrollWheelZoom = r.Handler.extend({
          addHooks: function () {
            r.DomEvent.on(this._map._container, "mousewheel", this._onWheelScroll, this), r.DomEvent.on(this._map._container, "MozMousePixelScroll", r.DomEvent.preventDefault), this._delta = 0
          }, removeHooks: function () {
            r.DomEvent.off(this._map._container, "mousewheel", this._onWheelScroll), r.DomEvent.off(this._map._container, "MozMousePixelScroll", r.DomEvent.preventDefault)
          }, _onWheelScroll: function (t) {
            var e = r.DomEvent.getWheelDelta(t);
            this._delta += e, this._lastMousePos = this._map.mouseEventToContainerPoint(t), this._startTime || (this._startTime = +new Date);
            var i = Math.max(40 - (+new Date - this._startTime), 0);
            clearTimeout(this._timer), this._timer = setTimeout(r.bind(this._performZoom, this), i), r.DomEvent.preventDefault(t), r.DomEvent.stopPropagation(t)
          }, _performZoom: function () {
            var t = this._map, e = this._delta, i = t.getZoom();
            e = e > 0 ? Math.ceil(e) : Math.floor(e), e = Math.max(Math.min(e, 4), -4), e = t._limitZoom(i + e) - i, this._delta = 0, this._startTime = null, e && ("center" === t.options.scrollWheelZoom ? t.setZoom(i + e) : t.setZoomAround(this._lastMousePos, i + e))
          }
        }), r.Map.addInitHook("addHandler", "scrollWheelZoom", r.Map.ScrollWheelZoom), r.extend(r.DomEvent, {
          _touchstart: r.Browser.msPointer ? "MSPointerDown" : r.Browser.pointer ? "pointerdown" : "touchstart",
          _touchend: r.Browser.msPointer ? "MSPointerUp" : r.Browser.pointer ? "pointerup" : "touchend",
          addDoubleTapListener: function (t, e, n) {
            function o(t) {
              var e;
              if (r.Browser.pointer ? (f.push(t.pointerId), e = f.length) : e = t.touches.length, !(e > 1)) {
                var i = Date.now(), n = i - (a || i);
                h = t.touches ? t.touches[0] : t, l = n > 0 && n <= u, a = i
              }
            }

            function s(t) {

              if (r.Browser.pointer) {
                var i = f.indexOf(t.pointerId);
                if (i === -1)return;
                f.splice(i, 1)
              }
              if (l) {
                if (r.Browser.pointer) {
                  var n, o = {};
                  for (var s in h)n = h[s], "function" == typeof n ? o[s] = n.bind(h) : o[s] = n;
                  h = o
                }
                h.type = "dblclick", e(h), a = null
              }
            }

            var a, h, l = !1, u = 250, c = "_ngr_", p = this._touchstart, d = this._touchend, f = [];
            t[c + p + n] = o, t[c + d + n] = s;
            var _ = r.Browser.pointer ? i.documentElement : t;
            return t.addEventListener(p, o, !1), _.addEventListener(d, s, !1), r.Browser.pointer && _.addEventListener(r.DomEvent.POINTER_CANCEL, s, !1), this
          },
          removeDoubleTapListener: function (t, e) {
            var n = "_ngr_";
            return t.removeEventListener(this._touchstart, t[n + this._touchstart + e], !1), (r.Browser.pointer ? i.documentElement : t).removeEventListener(this._touchend, t[n + this._touchend + e], !1), r.Browser.pointer && i.documentElement.removeEventListener(r.DomEvent.POINTER_CANCEL, t[n + this._touchend + e], !1), this
          }
        }), r.extend(r.DomEvent, {
          POINTER_DOWN: r.Browser.msPointer ? "MSPointerDown" : "pointerdown",
          POINTER_MOVE: r.Browser.msPointer ? "MSPointerMove" : "pointermove",
          POINTER_UP: r.Browser.msPointer ? "MSPointerUp" : "pointerup",
          POINTER_CANCEL: r.Browser.msPointer ? "MSPointerCancel" : "pointercancel",
          _pointers: [],
          _pointerDocumentListener: !1,
          addPointerListener: function (t, e, i, n) {
            switch (e) {
              case"touchstart":
                return this.addPointerListenerStart(t, e, i, n);
              case"touchend":
                return this.addPointerListenerEnd(t, e, i, n);
              case"touchmove":
                return this.addPointerListenerMove(t, e, i, n);
              default:
                throw"Unknown touch event type"
            }
          },
          addPointerListenerStart: function (t, e, n, o) {
            var s = "_ngr_", a = this._pointers, h = function (t) {
              r.DomEvent.preventDefault(t);
              for (var e = !1, i = 0; i < a.length; i++)if (a[i].pointerId === t.pointerId) {
                e = !0;
                break
              }
              e || a.push(t), t.touches = a.slice(), t.changedTouches = [t], n(t)
            };
            if (t[s + "touchstart" + o] = h, t.addEventListener(this.POINTER_DOWN, h, !1), !this._pointerDocumentListener) {
              var l = function (t) {
                for (var e = 0; e < a.length; e++)if (a[e].pointerId === t.pointerId) {
                  a.splice(e, 1);
                  break
                }
              };
              i.documentElement.addEventListener(this.POINTER_UP, l, !1), i.documentElement.addEventListener(this.POINTER_CANCEL, l, !1), this._pointerDocumentListener = !0
            }
            return this
          },
          addPointerListenerMove: function (t, e, i, n) {

            function o(t) {
              if (t.pointerType !== t.MSPOINTER_TYPE_MOUSE && "mouse" !== t.pointerType || 0 !== t.buttons) {
                for (var e = 0; e < s.length; e++)if (s[e].pointerId === t.pointerId) {
                  s[e] = t;
                  break
                }
                t.touches = s.slice(), t.changedTouches = [t], i(t)
              }
            }

            var r = "_ngr_", s = this._pointers;
            return t[r + "touchmove" + n] = o, t.addEventListener(this.POINTER_MOVE, o, !1), this
          },
          addPointerListenerEnd: function (t, e, i, n) {
            var o = "_ngr_", r = this._pointers, s = function (t) {
              for (var e = 0; e < r.length; e++)if (r[e].pointerId === t.pointerId) {
                r.splice(e, 1);
                break
              }
              t.touches = r.slice(), t.changedTouches = [t], i(t)
            };
            return t[o + "touchend" + n] = s, t.addEventListener(this.POINTER_UP, s, !1), t.addEventListener(this.POINTER_CANCEL, s, !1), this
          },
          removePointerListener: function (t, e, i) {
            var n = "_ngr_", o = t[n + e + i];
            switch (e) {
              case"touchstart":
                t.removeEventListener(this.POINTER_DOWN, o, !1);
                break;
              case"touchmove":
                t.removeEventListener(this.POINTER_MOVE, o, !1);
                break;
              case"touchend":
                t.removeEventListener(this.POINTER_UP, o, !1), t.removeEventListener(this.POINTER_CANCEL, o, !1)
            }
            return this
          }
        }), r.Map.mergeOptions({
          touchZoom: r.Browser.touch && !r.Browser.android23,
          bounceAtZoomLimits: !0
        }), r.Map.TouchZoom = r.Handler.extend({
          addHooks: function () {
            r.DomEvent.on(this._map._container, "touchstart", this._onTouchStart, this)
          }, removeHooks: function () {
            r.DomEvent.off(this._map._container, "touchstart", this._onTouchStart, this)
          }, _onTouchStart: function (t) {
            var e = this._map;
            if (t.touches && 2 === t.touches.length && !e._animatingZoom && !this._zooming) {
              var n = e.mouseEventToLayerPoint(t.touches[0]), o = e.mouseEventToLayerPoint(t.touches[1]),
                s = e._getCenterLayerPoint();
              this._startCenter = n.add(o)._divideBy(2), this._startDist = n.distanceTo(o), this._moved = !1, this._zooming = !0, this._centerOffset = s.subtract(this._startCenter), e._panAnim && e._panAnim.stop(), r.DomEvent.on(i, "touchmove", this._onTouchMove, this).on(i, "touchend", this._onTouchEnd, this), r.DomEvent.preventDefault(t)
            }
          }, _onTouchMove: function (t) {
            var e = this._map;
            if (t.touches && 2 === t.touches.length && this._zooming) {
              var i = e.mouseEventToLayerPoint(t.touches[0]), n = e.mouseEventToLayerPoint(t.touches[1]);
              this._scale = i.distanceTo(n) / this._startDist, this._delta = i._add(n)._divideBy(2)._subtract(this._startCenter), 1 !== this._scale && (!e.options.bounceAtZoomLimits && (e.getZoom() === e.getMinZoom() && this._scale < 1 || e.getZoom() === e.getMaxZoom() && this._scale > 1) || (this._moved || (r.DomUtil.addClass(e._mapPane, "ngr-touching"), e.fire("movestart").fire("zoomstart"), this._moved = !0), r.Util.cancelAnimFrame(this._animRequest), this._animRequest = r.Util.requestAnimFrame(this._updateOnMove, this, !0, this._map._container), r.DomEvent.preventDefault(t)))
            }
          }, _updateOnMove: function () {
            var t = this._map, e = this._getScaleOrigin(), i = t.layerPointToLatLng(e), n = t.getScaleZoom(this._scale);
            t._animateZoom(i, n, this._startCenter, this._scale, this._delta, !1, !0)
          }, _onTouchEnd: function () {
            if (!this._moved || !this._zooming)return void(this._zooming = !1);
            var t = this._map;
            this._zooming = !1, r.DomUtil.removeClass(t._mapPane, "ngr-touching"), r.Util.cancelAnimFrame(this._animRequest), r.DomEvent.off(i, "touchmove", this._onTouchMove).off(i, "touchend", this._onTouchEnd);
            var e = this._getScaleOrigin(), n = t.layerPointToLatLng(e), o = t.getZoom(),
              s = t.getScaleZoom(this._scale) - o, a = s > 0 ? Math.ceil(s) : Math.floor(s), h = t._limitZoom(o + a),
              l = t.getZoomScale(h) / this._scale;
            t._animateZoom(n, h, e, l)
          }, _getScaleOrigin: function () {
            var t = this._centerOffset.subtract(this._delta).divideBy(this._scale);
            return this._startCenter.add(t)
          }
        }), r.Map.addInitHook("addHandler", "touchZoom", r.Map.TouchZoom), r.Map.mergeOptions({
          tap: !0,
          tapTolerance: 15
        }), r.Map.Tap = r.Handler.extend({
          addHooks: function () {
            r.DomEvent.on(this._map._container, "touchstart", this._onDown, this)
          }, removeHooks: function () {
            r.DomEvent.off(this._map._container, "touchstart", this._onDown, this)
          }, _onDown: function (t) {
            if (t.touches) {
              if (r.DomEvent.preventDefault(t), this._fireClick = !0, t.touches.length > 1)return this._fireClick = !1, void clearTimeout(this._holdTimeout);
              var e = t.touches[0], n = e.target;
              this._startPos = this._newPos = new r.Point(e.clientX, e.clientY), n.tagName && "a" === n.tagName.toLowerCase() && r.DomUtil.addClass(n, "ngr-active"), this._holdTimeout = setTimeout(r.bind(function () {
                this._isTapValid() && (this._fireClick = !1, this._onUp(), this._simulateEvent("contextmenu", e))
              }, this), 1e3), r.DomEvent.on(i, "touchmove", this._onMove, this).on(i, "touchend", this._onUp, this)
            }
          }, _onUp: function (t) {
            if (clearTimeout(this._holdTimeout), r.DomEvent.off(i, "touchmove", this._onMove, this).off(i, "touchend", this._onUp, this), this._fireClick && t && t.changedTouches) {
              var e = t.changedTouches[0], n = e.target;
              n && n.tagName && "a" === n.tagName.toLowerCase() && r.DomUtil.removeClass(n, "ngr-active"), this._isTapValid() && this._simulateEvent("click", e)
            }
          }, _isTapValid: function () {
            return this._newPos.distanceTo(this._startPos) <= this._map.options.tapTolerance
          }, _onMove: function (t) {
            var e = t.touches[0];
            this._newPos = new r.Point(e.clientX, e.clientY)
          }, _simulateEvent: function (e, n) {
            var o = i.createEvent("MouseEvents");
            o._simulated = !0, n.target._simulatedClick = !0, o.initMouseEvent(e, !0, !0, t, 1, n.screenX, n.screenY, n.clientX, n.clientY, !1, !1, !1, !1, 0, null), n.target.dispatchEvent(o)
          }
        }), r.Browser.touch && !r.Browser.pointer && r.Map.addInitHook("addHandler", "tap", r.Map.Tap), r.Map.mergeOptions({boxZoom: !0}), r.Map.BoxZoom = r.Handler.extend({
          initialize: function (t) {
            this._map = t, this._container = t._container, this._pane = t._panes.overlayPane, this._moved = !1
          }, addHooks: function () {
            r.DomEvent.on(this._container, "mousedown", this._onMouseDown, this)
          }, removeHooks: function () {
            r.DomEvent.off(this._container, "mousedown", this._onMouseDown), this._moved = !1
          }, moved: function () {
            return this._moved
          }, _onMouseDown: function (t) {
            return this._moved = !1, !(!t.shiftKey || 1 !== t.which && 1 !== t.button) && (r.DomUtil.disableTextSelection(), r.DomUtil.disableImageDrag(), this._startLayerPoint = this._map.mouseEventToLayerPoint(t), void r.DomEvent.on(i, "mousemove", this._onMouseMove, this).on(i, "mouseup", this._onMouseUp, this).on(i, "keydown", this._onKeyDown, this))
          }, _onMouseMove: function (t) {
            this._moved || (this._box = r.DomUtil.create("div", "ngr-zoom-box", this._pane), r.DomUtil.setPosition(this._box, this._startLayerPoint), this._container.style.cursor = "crosshair", this._map.fire("boxzoomstart"));
            var e = this._startLayerPoint, i = this._box, n = this._map.mouseEventToLayerPoint(t), o = n.subtract(e),
              s = new r.Point(Math.min(n.x, e.x), Math.min(n.y, e.y));
            r.DomUtil.setPosition(i, s), this._moved = !0, i.style.width = Math.max(0, Math.abs(o.x) - 4) + "px", i.style.height = Math.max(0, Math.abs(o.y) - 4) + "px"
          }, _finish: function () {
            this._moved && (this._pane.removeChild(this._box), this._container.style.cursor = ""), r.DomUtil.enableTextSelection(), r.DomUtil.enableImageDrag(), r.DomEvent.off(i, "mousemove", this._onMouseMove).off(i, "mouseup", this._onMouseUp).off(i, "keydown", this._onKeyDown)
          }, _onMouseUp: function (t) {
            this._finish();
            var e = this._map, i = e.mouseEventToLayerPoint(t);
            if (!this._startLayerPoint.equals(i)) {
              var n = new r.LatLngBounds(e.layerPointToLatLng(this._startLayerPoint), e.layerPointToLatLng(i));
              e.fitBounds(n), e.fire("boxzoomend", {boxZoomBounds: n})
            }
          }, _onKeyDown: function (t) {
            27 === t.keyCode && this._finish()
          }
        }), r.Map.addInitHook("addHandler", "boxZoom", r.Map.BoxZoom), r.Map.mergeOptions({
          keyboard: !0,
          keyboardPanOffset: 80,
          keyboardZoomOffset: 1
        }), r.Map.Keyboard = r.Handler.extend({
          keyCodes: {
            left: [37],
            right: [39],
            down: [40],
            up: [38],
            zoomIn: [187, 107, 61, 171],
            zoomOut: [189, 109, 173]
          }, initialize: function (t) {
            this._map = t, this._setPanOffset(t.options.keyboardPanOffset), this._setZoomOffset(t.options.keyboardZoomOffset)
          }, addHooks: function () {
            var t = this._map._container;
            t.tabIndex === -1 && (t.tabIndex = "0"), r.DomEvent.on(t, "focus", this._onFocus, this).on(t, "blur", this._onBlur, this).on(t, "mousedown", this._onMouseDown, this), this._map.on("focus", this._addHooks, this).on("blur", this._removeHooks, this)
          }, removeHooks: function () {
            this._removeHooks();
            var t = this._map._container;
            r.DomEvent.off(t, "focus", this._onFocus, this).off(t, "blur", this._onBlur, this).off(t, "mousedown", this._onMouseDown, this), this._map.off("focus", this._addHooks, this).off("blur", this._removeHooks, this)
          }, _onMouseDown: function () {
            if (!this._focused) {
              var e = i.body, n = i.documentElement, o = e.scrollTop || n.scrollTop, r = e.scrollLeft || n.scrollLeft;
              this._map._container.focus(), t.scrollTo(r, o)
            }
          }, _onFocus: function () {
            this._focused = !0, this._map.fire("focus")
          }, _onBlur: function () {
            this._focused = !1, this._map.fire("blur")
          }, _setPanOffset: function (t) {
            var e, i, n = this._panKeys = {}, o = this.keyCodes;
            for (e = 0, i = o.left.length; e < i; e++)n[o.left[e]] = [-1 * t, 0];
            for (e = 0, i = o.right.length; e < i; e++)n[o.right[e]] = [t, 0];
            for (e = 0, i = o.down.length; e < i; e++)n[o.down[e]] = [0, t];
            for (e = 0, i = o.up.length; e < i; e++)n[o.up[e]] = [0, -1 * t]
          }, _setZoomOffset: function (t) {
            var e, i, n = this._zoomKeys = {}, o = this.keyCodes;
            for (e = 0, i = o.zoomIn.length; e < i; e++)n[o.zoomIn[e]] = t;
            for (e = 0, i = o.zoomOut.length; e < i; e++)n[o.zoomOut[e]] = -t
          }, _addHooks: function () {
            r.DomEvent.on(i, "keydown", this._onKeyDown, this)
          }, _removeHooks: function () {
            r.DomEvent.off(i, "keydown", this._onKeyDown, this)
          }, _onKeyDown: function (t) {
            var e = t.keyCode, i = this._map;
            if (e in this._panKeys) {
              if (i._panAnim && i._panAnim._inProgress)return;
              i.panBy(this._panKeys[e]), i.options.maxBounds && i.panInsideBounds(i.options.maxBounds)
            } else if (e in this._zoomKeys) i.setZoom(i.getZoom() + this._zoomKeys[e]); else {
              if (27 !== e)return;
              i.closePopup()
            }
            r.DomEvent.stop(t)
          }
        }), r.Map.addInitHook("addHandler", "keyboard", r.Map.Keyboard), r.Handler.MarkerDrag = r.Handler.extend({
          initialize: function (t) {
            this._marker = t
          }, addHooks: function () {
            var t = this._marker._icon;
            this._draggable || (this._draggable = new r.Draggable(t, t)), this._draggable.on("dragstart", this._onDragStart, this).on("drag", this._onDrag, this).on("dragend", this._onDragEnd, this), this._draggable.enable(), r.DomUtil.addClass(this._marker._icon, "ngr-marker-draggable")
          }, removeHooks: function () {
            this._draggable.off("dragstart", this._onDragStart, this).off("drag", this._onDrag, this).off("dragend", this._onDragEnd, this), this._draggable.disable(), r.DomUtil.removeClass(this._marker._icon, "ngr-marker-draggable")
          }, moved: function () {
            return this._draggable && this._draggable._moved
          }, _onDragStart: function () {
            this._marker.closePopup().fire("movestart").fire("dragstart")
          }, _onDrag: function () {
            var t = this._marker, e = t._shadow, i = r.DomUtil.getPosition(t._icon), n = t._map.layerPointToLatLng(i);
            e && r.DomUtil.setPosition(e, i), t._latlng = n, t.fire("move", {latlng: n}).fire("drag")
          }, _onDragEnd: function (t) {
            this._marker.fire("moveend").fire("dragend", t)
          }
        }), r.Control = r.Class.extend({
          options: {position: "topright"}, initialize: function (t) {
            r.setOptions(this, t)
          }, getPosition: function () {
            return this.options.position
          }, setPosition: function (t) {
            var e = this._map;
            return e && e.removeControl(this), this.options.position = t, e && e.addControl(this), this
          }, getContainer: function () {
            return this._container
          }, addTo: function (t) {
            this._map = t;
            // 不是
            var e = this._container = this.onAdd(t), i = this.getPosition(), n = t._controlCorners[i];
            return r.DomUtil.addClass(e, "ngr-control"), i.indexOf("bottom") !== -1 ? n.insertBefore(e, n.firstChild) : n.appendChild(e), this
          }, removeFrom: function (t) {
            var e = this.getPosition(), i = t._controlCorners[e];
            return i.removeChild(this._container), this._map = null, this.onRemove && this.onRemove(t), this
          }, _refocusOnMap: function () {
            this._map && this._map.getContainer().focus()
          }
        }), r.control = function (t) {
          return new r.Control(t)
        }, r.Map.include({
          addControl: function (t) {
            return t.addTo(this), this
          }, removeControl: function (t) {
            return t.removeFrom(this), this
          }, _initControlPos: function () {
            function t(t, o) {
              var s = i + t + " " + i + o;
              e[t + o] = r.DomUtil.create("div", s, n)
            }

            var e = this._controlCorners = {}, i = "ngr-",
              n = this._controlContainer = r.DomUtil.create("div", i + "control-container", this._container);
            t("top", "left"), t("top", "right"), t("bottom", "left"), t("bottom", "right")
          }, _clearControlPos: function () {
            this._container.removeChild(this._controlContainer)
          }
        }), r.Control.Zoom = r.Control.extend({
          options: {
            position: "topleft",
            zoomInText: "+",
            zoomInTitle: "放大",
            zoomOutText: "-",
            zoomOutTitle: "缩小"
          }, onAdd: function (t) {
            var e = "ngr-control-zoom", i = r.DomUtil.create("div", e + " ngr-bar");
            return this._map = t, this._zoomInButton = this._createButton(this.options.zoomInText, this.options.zoomInTitle, e + "-in", i, this._zoomIn, this), this._zoomOutButton = this._createButton(this.options.zoomOutText, this.options.zoomOutTitle, e + "-out", i, this._zoomOut, this), this._updateDisabled(), t.on("zoomend zoomlevelschange", this._updateDisabled, this), i
          }, onRemove: function (t) {
            t.off("zoomend zoomlevelschange", this._updateDisabled, this)
          }, _zoomIn: function (t) {
            this._map.zoomIn(t.shiftKey ? 3 : 1)
          }, _zoomOut: function (t) {
            this._map.zoomOut(t.shiftKey ? 3 : 1)
          }, _createButton: function (t, e, i, n, o, s) {
            var a = r.DomUtil.create("a", i, n);
            a.innerHTML = t, a.href = "#", a.title = e;
            var h = r.DomEvent.stopPropagation;
            return r.DomEvent.on(a, "click", h).on(a, "mousedown", h).on(a, "dblclick", h).on(a, "click", r.DomEvent.preventDefault).on(a, "click", o, s).on(a, "click", this._refocusOnMap, s), a
          }, _updateDisabled: function () {
            var t = this._map, e = "ngr-disabled";
            r.DomUtil.removeClass(this._zoomInButton, e), r.DomUtil.removeClass(this._zoomOutButton, e), t._zoom === t.getMinZoom() && r.DomUtil.addClass(this._zoomOutButton, e), t._zoom === t.getMaxZoom() && r.DomUtil.addClass(this._zoomInButton, e)
          }
        }), r.Map.mergeOptions({zoomControl: !0}), r.Map.addInitHook(function () {
          this.options.zoomControl && (this.zoomControl = new r.Control.Zoom, this.addControl(this.zoomControl))
        }), r.control.zoom = function (t) {
          return new r.Control.Zoom(t)
        }, r.Control.Attribution = r.Control.extend({
          options: {position: "bottomright", prefix: ""},
          initialize: function (t) {
            r.setOptions(this, t), this._attributions = {}
          },
          onAdd: function (t) {
            this._container = r.DomUtil.create("div", "ngr-control-attribution"), r.DomEvent.disableClickPropagation(this._container);
            for (var e in t._layers)t._layers[e].getAttribution && this.addAttribution(t._layers[e].getAttribution());
            return t.on("layeradd", this._onLayerAdd, this).on("layerremove", this._onLayerRemove, this), this._update(), this._container
          },
          onRemove: function (t) {
            t.off("layeradd", this._onLayerAdd).off("layerremove", this._onLayerRemove)
          },
          setPrefix: function (t) {
            return this.options.prefix = t, this._update(), this
          },
          addAttribution: function (t) {
            if (t)return this._attributions[t] || (this._attributions[t] = 0), this._attributions[t]++, this._update(), this
          },
          removeAttribution: function (t) {
            if (t)return this._attributions[t] && (this._attributions[t]--, this._update()), this
          },
          _update: function () {
            if (this._map) {
              var t = [];
              for (var e in this._attributions)this._attributions[e] && t.push(e);
              var i = [];
              this.options.prefix && i.push(this.options.prefix), t.length && i.push(t.join(", ")), this._container.innerHTML = i.join(" | ")
            }
          },
          _onLayerAdd: function (t) {
            t.layer.getAttribution && this.addAttribution(t.layer.getAttribution())
          },
          _onLayerRemove: function (t) {
            t.layer.getAttribution && this.removeAttribution(t.layer.getAttribution())
          }
        }), r.Map.mergeOptions({attributionControl: !0}), r.Map.addInitHook(function () {
          this.options.attributionControl && (this.attributionControl = (new r.Control.Attribution).addTo(this))
        }), r.control.attribution = function (t) {
          return new r.Control.Attribution(t)
        }, r.Control.Scale = r.Control.extend({
          options: {
            position: "bottomleft",
            maxWidth: 100,
            metric: !0,
            imperial: !0,
            updateWhenIdle: !1
          }, onAdd: function (t) {
            this._map = t;
            var e = "ngr-control-scale", i = r.DomUtil.create("div", e), n = this.options;
            return this._addScales(n, e, i), t.on(n.updateWhenIdle ? "moveend" : "move", this._update, this), t.whenReady(this._update, this), i
          }, onRemove: function (t) {
            t.off(this.options.updateWhenIdle ? "moveend" : "move", this._update, this)
          }, _addScales: function (t, e, i) {
            t.metric && (this._mScale = r.DomUtil.create("div", e + "-line", i)), t.imperial && (this._iScale = r.DomUtil.create("div", e + "-line", i))
          }, _update: function () {
            var t = this._map.getBounds(), e = t.getCenter().lat, i = 6378137 * Math.PI * Math.cos(e * Math.PI / 180),
              n = i * (t.getNorthEast().lng - t.getSouthWest().lng) / 180, o = this._map.getSize(), r = this.options,
              s = 0;
            o.x > 0 && (s = n * (r.maxWidth / o.x)), this._updateScales(r, s)
          }, _updateScales: function (t, e) {
            t.metric && e && this._updateMetric(e), t.imperial && e && this._updateImperial(e)
          }, _updateMetric: function (t) {
            var e = this._getRoundNum(t);
            this._mScale.style.width = this._getScaleWidth(e / t) + "px", this._mScale.innerHTML = e < 1e3 ? e + " 米" : e / 1e3 + " 公里"
          }, _updateImperial: function (t) {
            var e, i, n, o = 3.2808399 * t, r = this._iScale;
            o > 5280 ? (e = o / 5280, i = this._getRoundNum(e), r.style.width = this._getScaleWidth(i / e) + "px", r.innerHTML = i + " mi") : (n = this._getRoundNum(o), r.style.width = this._getScaleWidth(n / o) + "px", r.innerHTML = n + " ft")
          }, _getScaleWidth: function (t) {
            return Math.round(this.options.maxWidth * t) - 10
          }, _getRoundNum: function (t) {
            var e = Math.pow(10, (Math.floor(t) + "").length - 1), i = t / e;
            return i = i >= 10 ? 10 : i >= 5 ? 5 : i >= 3 ? 3 : i >= 2 ? 2 : 1, e * i
          }
        }), r.control.scale = function (t) {
          return new r.Control.Scale(t)
        }, r.Control.Layers = r.Control.extend({
          options: {collapsed: !0, position: "topright", autoZIndex: !0},
          initialize: function (t, e, i) {
            r.setOptions(this, i), this._layers = {}, this._lastZIndex = 0, this._handlingClick = !1;
            for (var n in t)this._addLayer(t[n], n);
            for (n in e)this._addLayer(e[n], n, !0)
          },
          onAdd: function (t) {
            return this._initLayout(), this._update(), t.on("layeradd", this._onLayerChange, this).on("layerremove", this._onLayerChange, this), this._container
          },
          onRemove: function (t) {
            t.off("layeradd", this._onLayerChange, this).off("layerremove", this._onLayerChange, this)
          },
          addBaseLayer: function (t, e) {
            return this._addLayer(t, e), this._update(), this
          },
          addOverlay: function (t, e) {
            return this._addLayer(t, e, !0), this._update(), this
          },
          removeLayer: function (t) {
            var e = r.stamp(t);
            return delete this._layers[e], this._update(), this
          },
          _initLayout: function () {
            var t = "ngr-control-layers", e = this._container = r.DomUtil.create("div", t);
            e.setAttribute("aria-haspopup", !0), r.Browser.touch ? r.DomEvent.on(e, "click", r.DomEvent.stopPropagation) : r.DomEvent.disableClickPropagation(e).disableScrollPropagation(e);
            var i = this._form = r.DomUtil.create("form", t + "-list");
            if (this.options.collapsed) {
              r.Browser.android || r.DomEvent.on(e, "mouseover", this._expand, this).on(e, "mouseout", this._collapse, this);
              var n = this._layersLink = r.DomUtil.create("a", t + "-toggle", e);
              n.href = "#", n.title = "Layers", r.Browser.touch ? r.DomEvent.on(n, "click", r.DomEvent.stop).on(n, "click", this._expand, this) : r.DomEvent.on(n, "focus", this._expand, this), r.DomEvent.on(i, "click", function () {
                setTimeout(r.bind(this._onInputClick, this), 0)
              }, this), this._map.on("click", this._collapse, this)
            } else this._expand();
            this._baseLayersList = r.DomUtil.create("div", t + "-base", i), this._separator = r.DomUtil.create("div", t + "-separator", i), this._overlaysList = r.DomUtil.create("div", t + "-overlays", i), e.appendChild(i)
          },
          _addLayer: function (t, e, i) {
            var n = r.stamp(t);
            this._layers[n] = {
              layer: t,
              name: e,
              overlay: i
            }, this.options.autoZIndex && t.setZIndex && (this._lastZIndex++, t.setZIndex(this._lastZIndex))
          },
          _update: function () {
            if (this._container) {
              this._baseLayersList.innerHTML = "", this._overlaysList.innerHTML = "";
              var t, e, i = !1, n = !1;
              for (t in this._layers)e = this._layers[t], this._addItem(e), n = n || e.overlay, i = i || !e.overlay;
              this._separator.style.display = n && i ? "" : "none"
            }
          },
          _onLayerChange: function (t) {
            var e = this._layers[r.stamp(t.layer)];
            if (e) {
              this._handlingClick || this._update();
              var i = e.overlay ? "layeradd" === t.type ? "overlayadd" : "overlayremove" : "layeradd" === t.type ? "baselayerchange" : null;
              i && this._map.fire(i, e)
            }
          },
          _createRadioElement: function (t, e) {
            var n = '<input type="radio" class="ngr-control-layers-selector" name="' + t + '"';
            e && (n += ' checked="checked"'), n += "/>";
            var o = i.createElement("div");
            return o.innerHTML = n, o.firstChild
          },
          _addItem: function (t) {
            var e, n = i.createElement("label"), o = this._map.hasLayer(t.layer);
            t.overlay ? (e = i.createElement("input"), e.type = "checkbox", e.className = "ngr-control-layers-selector", e.defaultChecked = o) : e = this._createRadioElement("ngr-base-layers", o), e.layerId = r.stamp(t.layer), r.DomEvent.on(e, "click", this._onInputClick, this);
            var s = i.createElement("span");
            s.innerHTML = " " + t.name, n.appendChild(e), n.appendChild(s);
            var a = t.overlay ? this._overlaysList : this._baseLayersList;
            return a.appendChild(n), n
          },
          _onInputClick: function () {
            var t, e, i, n = this._form.getElementsByTagName("input"), o = n.length;
            for (this._handlingClick = !0, t = 0; t < o; t++)e = n[t], i = this._layers[e.layerId], e.checked && !this._map.hasLayer(i.layer) ? this._map.addLayer(i.layer) : !e.checked && this._map.hasLayer(i.layer) && this._map.removeLayer(i.layer);
            this._handlingClick = !1, this._refocusOnMap()
          },
          _expand: function () {
            r.DomUtil.addClass(this._container, "ngr-control-layers-expanded")
          },
          _collapse: function () {
            this._container.className = this._container.className.replace(" ngr-control-layers-expanded", "")
          }
        }), r.control.layers = function (t, e, i) {
          return new r.Control.Layers(t, e, i)
        }, r.PosAnimation = r.Class.extend({
          includes: r.Mixin.Events, run: function (t, e, i, n) {
            this.stop(), this._el = t, this._inProgress = !0, this._newPos = e, this.fire("start"), t.style[r.DomUtil.TRANSITION] = "all " + (i || .25) + "s cubic-bezier(0,0," + (n || .5) + ",1)", r.DomEvent.on(t, r.DomUtil.TRANSITION_END, this._onTransitionEnd, this), r.DomUtil.setPosition(t, e), r.Util.falseFn(t.offsetWidth), this._stepTimer = setInterval(r.bind(this._onStep, this), 50)
          }, stop: function () {
            this._inProgress && (r.DomUtil.setPosition(this._el, this._getPos()), this._onTransitionEnd(), r.Util.falseFn(this._el.offsetWidth))
          }, _onStep: function () {
            var t = this._getPos();
            return t ? (this._el._ngr_pos = t, void this.fire("step")) : void this._onTransitionEnd()
          }, _transformRe: /([-+]?(?:\d*\.)?\d+)\D*, ([-+]?(?:\d*\.)?\d+)\D*\)/, _getPos: function () {
            var e, i, n, o = this._el, s = t.getComputedStyle(o);
            if (r.Browser.any3d) {
              if (n = s[r.DomUtil.TRANSFORM].match(this._transformRe), !n)return;
              e = parseFloat(n[1]), i = parseFloat(n[2])
            } else e = parseFloat(s.left), i = parseFloat(s.top);
            return new r.Point(e, i, (!0))
          }, _onTransitionEnd: function () {
            r.DomEvent.off(this._el, r.DomUtil.TRANSITION_END, this._onTransitionEnd, this), this._inProgress && (this._inProgress = !1, this._el.style[r.DomUtil.TRANSITION] = "", this._el._ngr_pos = this._newPos, clearInterval(this._stepTimer), this.fire("step").fire("end"))
          }
        }), r.Map.include({
          setView: function (t, e, i) {
            if (e = e === n ? this._zoom : this._limitZoom(e), t = this._limitCenter(r.latLng(t), e, this.options.maxBounds), i = i || {}, this._panAnim && this._panAnim.stop(), this._loaded && !i.reset && i !== !0) {
              i.animate !== n && (i.zoom = r.extend({animate: i.animate}, i.zoom), i.pan = r.extend({animate: i.animate}, i.pan));
              var o = this._zoom !== e ? this._tryAnimatedZoom && this._tryAnimatedZoom(t, e, i.zoom) : this._tryAnimatedPan(t, i.pan);
              if (o)return clearTimeout(this._sizeTimer), this
            }
            return this._resetView(t, e), this
          }, panBy: function (t, e) {
            if (t = r.point(t).round(), e = e || {}, !t.x && !t.y)return this;
            if (this._panAnim || (this._panAnim = new r.PosAnimation, this._panAnim.on({
                step: this._onPanTransitionStep,
                end: this._onPanTransitionEnd
              }, this)), e.noMoveStart || this.fire("movestart"), e.animate !== !1) {
              r.DomUtil.addClass(this._mapPane, "ngr-pan-anim");
              var i = this._getMapPanePos().subtract(t);
              this._panAnim.run(this._mapPane, i, e.duration || .25, e.easeLinearity)
            } else this._rawPanBy(t), this.fire("move").fire("moveend");
            return this
          }, _onPanTransitionStep: function () {
            this.fire("move")
          }, _onPanTransitionEnd: function () {
            r.DomUtil.removeClass(this._mapPane, "ngr-pan-anim"), r.Browser.mobile && Object.keys(NGR.Cache._imageCache).length > 0 ? this._delayId || (this._delayId = setTimeout(function () {
                this._delayId = null, this.fire("moveend")
              }.bind(this), 500)) : this.fire("moveend")
          }, _tryAnimatedPan: function (t, e) {
            var i = this._getCenterOffset(t)._floor();
            return !((e && e.animate) !== !0 && !this.getSize().contains(i)) && (this.panBy(i, e), !0)
          }
        }), r.PosAnimation = r.DomUtil.TRANSITION ? r.PosAnimation : r.PosAnimation.extend({
          run: function (t, e, i, n) {
            this.stop(), this._el = t, this._inProgress = !0, this._duration = i || .25, this._easeOutPower = 1 / Math.max(n || .5, .2), this._startPos = r.DomUtil.getPosition(t), this._offset = e.subtract(this._startPos), this._startTime = +new Date, this.fire("start"), this._animate()
          }, stop: function () {
            this._inProgress && (this._step(), this._complete())
          }, _animate: function () {
            this._animId = r.Util.requestAnimFrame(this._animate, this), this._step()
          }, _step: function () {
            var t = +new Date - this._startTime, e = 1e3 * this._duration;
            t < e ? this._runFrame(this._easeOut(t / e)) : (this._runFrame(1), this._complete())
          }, _runFrame: function (t) {
            var e = this._startPos.add(this._offset.multiplyBy(t));
            r.DomUtil.setPosition(this._el, e), this.fire("step")
          }, _complete: function () {
            r.Util.cancelAnimFrame(this._animId), this._inProgress = !1, this.fire("end")
          }, _easeOut: function (t) {
            return 1 - Math.pow(1 - t, this._easeOutPower)
          }
        }), r.Map.mergeOptions({
          zoomAnimation: !0,
          zoomAnimationThreshold: 4
        }), r.DomUtil.TRANSITION && r.Map.addInitHook(function () {
          this._zoomAnimated = this.options.zoomAnimation && r.DomUtil.TRANSITION && r.Browser.any3d && !r.Browser.android23 && !r.Browser.mobileOpera, this._zoomAnimated && r.DomEvent.on(this._mapPane, r.DomUtil.TRANSITION_END, this._catchTransitionEnd, this)
        }), r.Map.include(r.DomUtil.TRANSITION ? {
          _catchTransitionEnd: function (t) {
            this._animatingZoom && t.propertyName.indexOf("transform") >= 0 && this._onZoomTransitionEnd()
          }, _nothingToAnimate: function () {
            return !this._container.getElementsByClassName("ngr-zoom-animated").length
          }, _tryAnimatedZoom: function (t, e, i) {
            if (this._animatingZoom)return !0;
            if (i = i || {}, !this._zoomAnimated || i.animate === !1 || this._nothingToAnimate() || Math.abs(e - this._zoom) > this.options.zoomAnimationThreshold)return !1;
            var n = this.getZoomScale(e), o = this._getCenterOffset(t)._divideBy(1 - 1 / n),
              r = this._getCenterLayerPoint()._add(o);
            return !(i.animate !== !0 && !this.getSize().contains(o)) && (this.fire("movestart").fire("zoomstart"), this._animateZoom(t, e, r, n, null, !0), !0)
          }, _animateZoom: function (t, e, i, n, o, s, a) {
            a || (this._animatingZoom = !0), r.DomUtil.addClass(this._mapPane, "ngr-zoom-anim"), this._animateToCenter = t, this._animateToZoom = e, r.Draggable && (r.Draggable._disabled = !0), r.Util.requestAnimFrame(function () {
              this.fire("zoomanim", {center: t, zoom: e, origin: i, scale: n, delta: o, backwards: s})
            }, this)
          }, _onZoomTransitionEnd: function () {
            this._animatingZoom = !1, r.DomUtil.removeClass(this._mapPane, "ngr-zoom-anim"), this._resetView(this._animateToCenter, this._animateToZoom, !0, !0), r.Draggable && (r.Draggable._disabled = !1)
          }
        } : {}), r.TileLayer.include({
          _animateZoom: function (t) {
            this._animating || (this._animating = !0, this._prepareBgBuffer());
            var e = this._bgBuffer, i = r.DomUtil.TRANSFORM,
              n = t.delta ? r.DomUtil.getTranslateString(t.delta) : e.style[i],
              o = r.DomUtil.getScaleString(t.scale, t.origin);
            e.style[i] = t.backwards ? o + " " + n : n + " " + o
          }, _endZoomAnim: function () {
            var t = this._tileContainer, e = this._bgBuffer;
            t.style.visibility = "", t.parentNode.appendChild(t), r.Util.falseFn(e.offsetWidth), this._animating = !1
          }, _clearBgBuffer: function () {
            var t = this._map;
            !t || t._animatingZoom || t.touchZoom._zooming || (this._bgBuffer.innerHTML = "", this._bgBuffer.style[r.DomUtil.TRANSFORM] = "")
          }, _prepareBgBuffer: function () {
            var t = this._tileContainer, e = this._bgBuffer, i = this._getLoadedTilesPercentage(e),
              n = this._getLoadedTilesPercentage(t);
            return e && i > .5 && n < .5 ? (t.style.visibility = "hidden", void this._stopLoadingImages(t)) : (e.style.visibility = "hidden", e.style[r.DomUtil.TRANSFORM] = "", this._tileContainer = e, e = this._bgBuffer = t, this._stopLoadingImages(e), void clearTimeout(this._clearBgBufferTimer))
          }, _getLoadedTilesPercentage: function (t) {
            var e, i, n = t.getElementsByTagName("img"), o = 0;
            for (e = 0, i = n.length; e < i; e++)n[e].complete && o++;
            return o / i
          }, _stopLoadingImages: function (t) {
            var e, i, n, o = Array.prototype.slice.call(t.getElementsByTagName("img"));
            for (e = 0, i = o.length; e < i; e++)n = o[e], n.complete || (n.onload = r.Util.falseFn, n.onerror = r.Util.falseFn, n.src = r.Util.emptyImageUrl, n.parentNode.removeChild(n))
          }
        }), r.Map.include({
          _defaultLocateOptions: {
            watch: !1,
            setView: !1,
            maxZoom: 1 / 0,
            timeout: 1e4,
            maximumAge: 0,
            enableHighAccuracy: !1
          }, locate: function (t) {
            if (t = this._locateOptions = r.extend(this._defaultLocateOptions, t), !navigator.geolocation)return this._handleGeolocationError({
              code: 0,
              message: "Geolocation not supported."
            }), this;
            var e = r.bind(this._handleGeolocationResponse, this), i = r.bind(this._handleGeolocationError, this);
            return t.watch ? this._locationWatchId = navigator.geolocation.watchPosition(e, i, t) : navigator.geolocation.getCurrentPosition(e, i, t), this
          }, stopLocate: function () {
            return navigator.geolocation && navigator.geolocation.clearWatch(this._locationWatchId), this._locateOptions && (this._locateOptions.setView = !1), this
          }, _handleGeolocationError: function (t) {
            var e = t.code,
              i = t.message || (1 === e ? "permission denied" : 2 === e ? "position unavailable" : "timeout");
            this._locateOptions.setView && !this._loaded && this.fitWorld(), this.fire("locationerror", {
              code: e,
              message: "Geolocation error: " + i + "."
            })
          }, _handleGeolocationResponse: function (t) {
            var e = t.coords.latitude, i = t.coords.longitude, n = new r.LatLng(e, i),
              o = 180 * t.coords.accuracy / 40075017, s = o / Math.cos(r.LatLng.DEG_TO_RAD * e),
              a = r.latLngBounds([e - o, i - s], [e + o, i + s]), h = this._locateOptions;
            if (h.setView) {
              var l = Math.min(this.getBoundsZoom(a), h.maxZoom);
              this.setView(n, l)
            }
            var u = {latlng: n, bounds: a, timestamp: t.timestamp};
            for (var c in t.coords)"number" == typeof t.coords[c] && (u[c] = t.coords[c]);
            this.fire("locationfound", u)
          }
        })
      }(window, document)
    }, {}], 23: [function (t, e, i) {
      !function (t) {
        function i(t) {
          switch (this.clear(), arguments.length) {
            case 0:
              break;
            case 1:
              this.copy(t);
              break;
            default:
              o(this, arguments)
          }
        }

        function n(t) {
          var e = Object.prototype.toString.call(t), i = e.slice(8, -1).toLowerCase();
          return "domwindow" !== i || t ? i : t + ""
        }

        function o(t, e) {
          for (var i = 0; i < e.length; i += 2)t.set(e[i], e[i + 1])
        }

        function r(t) {
          return function () {
            return t.apply(this, arguments), this
          }
        }

        function s(t, e) {
          Object.defineProperty && Object.defineProperty(t, e, {enumerable: !1})
        }

        function a(t, e) {
          this.x = t, this.y = e
        }

        function h(t, e) {
          this.firstPoint = t, this.secondPoint = e
        }

        function l(t, e) {
          this.scope = t, this.intercept = e
        }

        function u(t, e) {
          this.firstLine = t, this.secondLine = e
        }

        function c(t, e) {
          this.center = t, this.radius = e
        }

        function p(t, e) {
          this.firstCircle = t, this.secondCircle = e
        }

        function d(t, e, i, n, o, r, s, a, h, l, u) {
          this.beaconId = t, this.mapId = e, this.sceneId = i, this.floorId = n, this.uuid = o, this.major = r, this.minor = s, this.x = a, this.y = h, this.atten = l, this.lossCoe = u
        }

        function f(t, e, i, n) {
          this.uuid = t, this.major = e, this.minor = i, this.distance = n
        }

        function _() {
        }

        function m(t) {
          return this.rssiBoundary = t && t.rssiBoundary ? t.rssiBoundary : 10, this.distBoundary = t && t.distBoundary ? t.distBoundary : 6, this
        }

        function g() {
        }

        var y = i.prototype = {
          constructor: i, get: function (t) {
            var e = this._data[this.hash(t)];
            return e && e[1]
          }, put: function (t, e) {
            var i = this.hash(t);
            i in this._data || this._count++, this._data[i] = [t, e]
          }, multi: function () {
            o(this, arguments)
          }, copy: function (t) {
            for (var e in t._data)e in this._data || this._count++, this._data[e] = t._data[e]
          }, containsKey: function (t) {
            var e = this.hash(t), i = e in this._data;
            return i
          }, search: function (t) {
            for (var e in this._data)if (this._data[e][1] === t)return this._data[e][0];
            return null
          }, remove: function (t) {
            var e = this.hash(t);
            e in this._data && (this._count--, delete this._data[e])
          }, isEmpty: function () {
            return 0 == this._count
          }, keyArray: function () {
            var t = [];
            return this.forEach(function (e, i) {
              t.push(i)
            }), t
          }, values: function () {
            var t = [];
            return this.forEach(function (e) {
              t.push(e)
            }), t
          }, size: function () {
            return this._count
          }, clear: function () {
            this._data = {}, this._count = 0
          }, clone: function () {
            return new i(this)
          }, hash: function (t) {
            switch (n(t)) {
              case"undefined":
              case"null":
              case"boolean":
              case"number":
              case"regexp":
                return t + "";
              case"date":
                return "♣" + t.getTime();
              case"string":
                return "♠" + t;
              case"array":
                for (var e = [], o = 0; o < t.length; o++)e[o] = this.hash(t[o]);
                return "♥" + e.join("⁞");
              default:
                return t.hasOwnProperty("_hmuid_") || (t._hmuid_ = ++i.uid, s(t, "_hmuid_")), "♦" + t._hmuid_
            }
          }, forEach: function (t, e) {
            for (var i in this._data) {
              var n = this._data[i];
              t.call(e || this, n[1], n[0])
            }
          }
        };
        i.uid = 0;
        for (var v in y)if ("constructor" !== v && y.hasOwnProperty(v)) {
          var L = y[v];
          L.toString().indexOf("return ") === -1 && (y[v] = r(L))
        }
        a.prototype.setPoint = function (t, e) {
          this.x = t, this.y = e
        }, h.prototype.setPoints = function (t, e) {
          this.firstPoint = t, this.secondPoint = e
        }, h.prototype.getRelation = function () {
          var t = this.firstPoint.x == this.secondPoint.x ? 10 : 20,
            e = this.firstPoint.y == this.secondPoint.y ? 1 : 2, i = t + e, n = 0;
          switch (i) {
            case 11:
              n = 1;
              break;
            case 12:
              n = 2;
              break;
            case 21:
              n = 3;
              break;
            case 22:
              n = 4
          }
          return n
        }, h.prototype.getDistance = function () {
          return Math.sqrt((this.firstPoint.x - this.secondPoint.x) * (this.firstPoint.x - this.secondPoint.x) + (this.firstPoint.y - this.secondPoint.y) * (this.firstPoint.y - this.secondPoint.y));
        }, l.prototype.setLine = function (t, e) {
          this.scope = t, this.intercept = e
        }, l.prototype.lineGenerateByTwoPoints = function (t, e) {
          this.scope = (t.y - e.y) / (t.x - e.x), this.intercept = t.y - this.scope * t.x
        }, l.prototype.lineGenerateByPointScope = function (t, e) {
          this.scope = e, this.intercept = t.y - e * t.x
        }, u.prototype.setLines = function (t, e) {
          this.firstLine = t, this.secondLine = e
        }, u.prototype.getRelation = function () {
          var t = this.firstLine.scope == this.secondLine.scope ? 10 : 20,
            e = this.firstLine.intercept == this.secondLine.intercept ? 1 : 2, i = t + e, n = 0;
          switch (i) {
            case 11:
              n = 1;
              break;
            case 12:
              n = 2;
              break;
            case 21:
              n = 3;
              break;
            case 22:
              n = 4
          }
          return n
        }, u.prototype.insect = function () {
          var t = this.getRelation(), e = Object.create(a.prototype);
          switch (t) {
            case 3:
              e.setPoint(0, this.firstLine.intercept);
              break;
            case 4:
              var i = (this.secondLine.intercept - this.firstLine.intercept) / (this.firstLine.scope - this.secondLine.scope),
                n = this.firstLine.scope * i + this.firstLine.intercept;
              e.setPoint(i, n);
              break;
            default:
              console.log("no crossPoint between lines")
          }
          return e
        }, c.prototype.setCircle = function (t, e) {
          this.center = t, this.radius = e
        }, p.prototype.setCircles = function (t, e) {
          this.firstCircle = t, this.secondCircle = e
        }, p.prototype.getRelation = function () {
          var t = this.firstCircle.center == this.secondCircle.center ? 1 : 2,
            e = this.firstCircle.radius == this.secondCircle.radius ? 10 : 20, i = t + e, n = 0;
          switch (i) {
            case 11:
              n = 1;
              break;
            case 12:
              n = 2;
              break;
            case 21:
              n = 3;
              break;
            case 22:
              n = 4
          }
          return n
        }, p.prototype.insect = function () {
          for (var t = Object.create(Array.prototype), e = 0; e < 2; e++)t[e] = Object.create(a.prototype);
          var i = Object.create(h.prototype);
          i.setPoints(this.firstCircle.center, this.secondCircle.center);
          var n = i.getRelation();
          return t = this.locationOption(n)
        }, p.prototype.locationOption = function (t) {
          switch (t) {
            case 1:
              return this.CenterXYEqual();
            case 2:
              return this.CenterXEqual();
            case 3:
              return this.CenterYEqual();
            case 4:
              return this.CenterNoEqual();
            default:
              return 1
          }
        }, p.prototype.CenterXYEqual = function () {
          console.warn("the centers of the circle are the same!");
          for (var t = Object.create(Array.prototype), e = 0; e < 2; e++)t[e] = Object.create(a.prototype);
          return t[0] = w, t[1] = w, t
        }, p.prototype.CenterXEqual = function () {
          for (var t = Object.create(Array.prototype), e = 0; e < 2; e++)t[e] = Object.create(a.prototype);
          var i = 0, n = Math.abs(this.firstCircle.center.y - this.secondCircle.center.y);
          return this.firstCircle.center.y < this.secondCircle.center.y ? (i = (Math.pow(n, 2) + Math.pow(this.firstCircle.radius, 2) - Math.pow(this.secondCircle.radius, 2)) / (2 * this.firstCircle.radius * n), t[0].y = this.firstCircle.center.y + this.firstCircle.radius * i, t[1].y = t[0].y, t[0].x = this.firstCircle.center.x + this.firstCircle.radius * Math.sqrt(1 - Math.pow(i, 2)), t[1].x = this.firstCircle.center.x - this.firstCircle.radius * Math.sqrt(1 - Math.pow(i, 2))) : (i = (Math.pow(n, 2) + Math.pow(this.secondCircle.radius, 2) - Math.pow(this.firstCircle.radius, 2)) / (2 * this.secondCircle.radius * n), t[0].y = this.secondCircle.center.y + this.secondCircle.radius * i, t[1].y = t[0].y, t[0].x = this.secondCircle.center.x + this.secondCircle.radius * Math.sqrt(1 - Math.pow(i, 2)), t[1].x = this.secondCircle.center.x - this.secondCircle.radius * Math.sqrt(1 - Math.pow(i, 2))), t
        }, p.prototype.CenterYEqual = function () {
          for (var t = Object.create(Array.prototype), e = 0; e < 3; e++)t[e] = Object.create(a.prototype);
          var i = 0, n = Math.abs(this.firstCircle.center.x - this.secondCircle.center.x);
          return this.firstCircle.center.x < this.secondCircle.center.x ? (i = (Math.pow(n, 2) + Math.pow(this.firstCircle.radius, 2) - Math.pow(this.secondCircle.radius, 2)) / (2 * this.firstCircle.radius * n), t[0].x = this.firstCircle.center.x + this.firstCircle.radius * i, t[1].x = t[0].x, t[0].y = this.firstCircle.center.y + this.firstCircle.radius * Math.sqrt(1 - Math.pow(i, 2)), t[1].y = this.firstCircle.center.y - this.firstCircle.radius * Math.sqrt(1 - Math.pow(i, 2))) : (i = (Math.pow(n, 2) + Math.pow(this.secondCircle.radius, 2) - Math.pow(this.firstCircle.radius, 2)) / (2 * this.secondCircle.radius * n), t[0].x = this.secondCircle.center.x + this.secondCircle.radius * i, t[1].x = t[0].x, t[0].y = this.secondCircle.center.y + this.secondCircle.radius * Math.sqrt(1 - Math.pow(i, 2)), t[1].y = this.secondCircle.center.y - this.secondCircle.radius * Math.sqrt(1 - Math.pow(i, 2))), t
        }, p.prototype.CenterNoEqual = function () {
          for (var t = Object.create(Array.prototype), e = 0; e < 2; e++)t[e] = Object.create(a.prototype);
          var i, n, o, r, s, l, u = Object.create(Array.prototype), c = Object.create(Array.prototype),
            p = Object.create(Array.prototype), d = Object.create(_.prototype);
          for (e = 0; e < 3; e++)p[e] = Object.create(h.prototype);
          return p[0].setPoints(this.firstCircle.center, this.secondCircle.center), i = 2 * this.firstCircle.radius * (this.firstCircle.center.x - this.secondCircle.center.x), n = 2 * this.firstCircle.radius * (this.firstCircle.center.y - this.secondCircle.center.y), o = this.secondCircle.radius * this.secondCircle.radius - this.firstCircle.radius * this.firstCircle.radius - p[0].getDistance() * p[0].getDistance(), r = i * i + n * n, s = -2 * i * o, l = o * o - n * n, u[0] = (Math.sqrt(s * s - 4 * r * l) - s) / (2 * r), u[1] = (-Math.sqrt(s * s - 4 * r * l) - s) / (2 * r), c[0] = Math.sqrt(1 - u[0] * u[0]), c[1] = Math.sqrt(1 - u[1] * u[1]), t[0].x = this.firstCircle.radius * u[0] + this.firstCircle.center.x, t[1].x = this.firstCircle.radius * u[1] + this.firstCircle.center.x, t[0].y = this.firstCircle.radius * c[0] + this.firstCircle.center.y, t[1].y = this.firstCircle.radius * c[1] + this.firstCircle.center.y, p[1].setPoints(t[0], this.secondCircle.center), p[2].setPoints(t[1], this.secondCircle.center), d.varEquals(p[1].getDistance(), this.secondCircle.radius) || (t[0].y = this.firstCircle.center.y - this.firstCircle.radius * c[0]), d.varEquals(p[2].getDistance(), this.secondCircle.radius) || (t[1].y = this.firstCircle.center.y - this.firstCircle.radius * c[1]), d.varEquals(t[0].y, t[1].y) && d.varEquals(t[0].x, t[1].x) && (t[0].y > 0 ? t[1].y = -t[1].y : t[0].y = -t[0].y), t
        }, _.prototype.varEquals = function (t, e) {
          var i = .001;
          return t.constructor == Number && e.constructor == Number ? Math.abs(t - e) < i : (console.log("type error!"), -1)
        }, _.prototype.sortRule = function (t, e) {
          return t - e
        }, _.prototype.calcDistByRssi = function (t, e, i) {
          var n = Math.abs(t), o = Math.abs(e), r = (n - o) / (10 * i);
          return Math.pow(10, r)
        }, m.prototype.setBoundaries = function (t) {
          return this.rssiBoundary = t && t.rssiBoundary ? t.rssiBoundary : this.rssiBoundary ? this.rssiBoundary : 10, this.distBoundary = t && t.distBoundary ? t.distBoundary : this.distBoundary ? this.distBoundary : 6, this
        }, m.prototype.rssiFilter = function (t, e) {
          return t < 0 && t > e - this.rssiBoundary
        }, m.prototype.distanceFilter = function (t) {
          return t > 0 && t < this.distBoundary
        }, m.prototype.locationFilter = function (t, e) {
          var i = Object.create(a.prototype), n = Object.create(h.prototype), o = Object.create(a.prototype), r = 4;
          i.x = (t[0].x + t[1].x + t[2].x) / 3, i.y = (t[0].y + t[1].y + t[2].y) / 3, n.setPoints(i, e);
          var s = n.getDistance();
          return s > r ? (o.x = i.x + (e.x - i.x) * (r / s), o.y = i.y + (e.y - i.y) * (r / s), o) : e
        }, m.prototype.historyLocationFilter = function (t) {
          var e = Object.create(h.prototype), i = Object.create(a.prototype);
          e.setPoints(t, C);
          var n = 2, o = e.getDistance();
          return o <= n || 0 == C.x && 0 == C.y ? (C = t, t) : (i.x = C.x + (C.x - t.x) * (n / o), i.y = C.y + (C.y - t.y) * (n / o), C = i, i)
        }, g.prototype.parseInfo = function (t) {
          try {
            return JSON.parse(t)
          } catch (e) {
            return e
          }
        }, g.prototype.stringifyInfo = function (t) {
          try {
            return JSON.stringify(t)
          } catch (e) {
            return e
          }
        };
        var M = {
          BEACON_USE_NUM: "3",
          DIS_A: "0",
          DIS_B: "1",
          DIS_C: "2"
        }, w = new a((-1e3), (-1e3)), C = new a(0, 0), x = function (t, e) {
          this.BeaconsCfg = t, this.bleConfig = e, this.bleLocationInfo = function () {
            function t() {
              return void 0 == i && (i = new e), i
            }

            function e() {
              return e.instance = {
                type: "FeatureCollection",
                features: [{
                  type: "Feature",
                  properties: {floor_id: 0},
                  geometry: {type: "Point", coordinate: [0, 0]}
                }]
              }, e.instance
            }

            var i;
            return {getInstance: t}
          }(), this.bleLocationInfoInstance = this.bleLocationInfo.getInstance(), this.bleLocationStrategy = function (t, e, i, n) {
            var o;
            switch (t) {
              case 1:
                o = "beaconNumEqualOne";
                break;
              case 2:
                o = "beaconNumEqualTwo";
                break;
              case 3:
                o = "beaconNumEqualThree";
                break;
              default:
                o = "beaconNumMoreThanThree"
            }
            var r = function (t, e) {
              for (var i = Object.create(Array.prototype), n = Object.create(Array.prototype),
                     o = Object.create(Array.prototype),
                     r = 0; r < M.BEACON_USE_NUM; r++)o[r] = Object.create(h.prototype);
              o[0].setPoints(t[0], t[1]), o[1].setPoints(t[0], t[2]), o[2].setPoints(t[1], t[2]), i[0] = o[0].getDistance(), i[1] = o[1].getDistance(), i[2] = o[2].getDistance(), n[0] = e[M.DIS_A] + e[M.DIS_B], n[1] = e[M.DIS_A] + e[M.DIS_C], n[2] = e[M.DIS_B] + e[M.DIS_C], n[3] = Math.abs(e[M.DIS_A] - e[M.DIS_B]), n[4] = Math.abs([M.DIS_A] - e[M.DIS_C]), n[5] = Math.abs(e[M.DIS_B] - e[M.DIS_C]);
              var s,
                l = (i[0] > n[0] ? 300 : i[0] < n[3] ? 100 : 200, i[1] > n[1] ? 30 : i[1] < n[4] ? 10 : 20, i[2] > n[2] ? 3 : i[2] < n[5] ? 1 : 2, 333);
              switch (l) {
                case 333:
                  s = "allDeviation", console.info("C0-C1 C0-C2 C1-C2");
                  break;
                case 222:
                  s = "disWeightAlg", console.info("C0+C1 C0+C2 C1+C2");
                  break;
                case 233:
                  s = "CirTwoDeviation", console.info("C0+C1 C0-C2 C1-C2");
                  break;
                case 323:
                  s = "CirOneDeviation", console.info("C0-C1 C0+C2 C1-C2");
                  break;
                case 332:
                  s = "CirZeroDeviation", console.info("C0-C1 C0-C2 C1+C2");
                  break;
                case 221:
                case 223:
                  s = "CirOneTwoDeviation", console.info("C0+C1 C0+C2 C1-&C2");
                  break;
                case 212:
                case 232:
                  s = "CirZeroTwoDeviation", console.info("C0+C1 C0-&C2 C1+C2");
                  break;
                case 122:
                case 322:
                  s = "CirZeroOneDeviation", console.info("C0-&C1 C0+C2 C1+C2");
                  break;
                default:
                  console.log("no Result!")
              }
              var u = {
                allDeviation: function (t, e) {
                  for (var i = Object.create(Array.prototype), n = 0, o = 0, r = 0, s = 0; s < 3; ++s)n += 1 / e[s];
                  for (var h = 0; h < 3; ++h)i[h] = 1 / e[h] / n;
                  for (var l = Object.create(a.prototype), u = 0; u < 3; ++u)o += i[u] * t[u].x, r += i[u] * t[u].y;
                  return l.setPoint(o, r), l
                }, disWeightAlg: function (t, e) {
                  for (var i = Object.create(a.prototype), n = Object.create(Array.prototype),
                         o = Object.create(Array.prototype), r = Object.create(Array.prototype),
                         s = Object.create(Array.prototype),
                         l = 0; l < M.BEACON_USE_NUM; l++)n[l] = Object.create(c.prototype), o[l] = Object.create(p.prototype);
                  n[0].setCircle(t[0], e[M.DIS_A]), n[1].setCircle(t[1], e[M.DIS_B]), n[2].setCircle(t[2], e[M.DIS_C]), o[0].setCircles(n[0], n[1]), o[1].setCircles(n[0], n[2]), o[2].setCircles(n[1], n[2]), s[0] = o[0].insect(), s[1] = o[1].insect(), s[2] = o[2].insect();
                  var u = Object.create(Array.prototype);
                  for (l = 0; l < 2 * Number(M.BEACON_USE_NUM); l++)u[l] = Object.create(h.prototype);
                  return u[0].setPoints(s[0][0], t[2]), u[1].setPoints(s[0][1], t[2]), u[2].setPoints(s[1][0], t[1]), u[3].setPoints(s[1][1], t[1]), u[4].setPoints(s[2][0], t[0]), u[5].setPoints(s[2][1], t[0]), u[0].getDistance() < u[1].getDistance() ? r[0] = s[0][0] : r[0] = s[0][1], u[2].getDistance() < u[3].getDistance() ? r[1] = s[1][0] : r[1] = s[1][1], u[4].getDistance() < u[5].getDistance() ? r[2] = s[2][0] : r[2] = s[2][1], i.x = (r[0].x / (e[M.DIS_A] * e[M.DIS_A]) + r[1].x / (e[M.DIS_B] * e[M.DIS_B]) + r[2].x / (e[M.DIS_C] * e[M.DIS_C])) / (1 / (e[M.DIS_A] * e[M.DIS_A]) + 1 / (e[M.DIS_B] * e[M.DIS_B]) + 1 / (e[M.DIS_C] * e[M.DIS_C])), i.y = (r[0].y / (e[M.DIS_A] * e[M.DIS_A]) + r[1].y / (e[M.DIS_B] * e[M.DIS_B]) + r[2].y / (e[M.DIS_C] * e[M.DIS_C])) / (1 / (e[M.DIS_A] * e[M.DIS_A]) + 1 / (e[M.DIS_B] * e[M.DIS_B]) + 1 / (e[M.DIS_C] * e[M.DIS_C])), i
                }, CirZeroDeviation: function (t, e) {
                  for (var i = Object.create(a.prototype), n = Object.create(Array.prototype),
                         o = Object.create(p.prototype), r = Object.create(Array.prototype),
                         s = 0; s < 2; s++)n[s] = Object.create(c.prototype), r[s] = Object.create(h.prototype);
                  n[0].setCircle(t[1], e[1]), n[1].setCircle(t[2], e[2]), o.setCircles(n[0], n[1]);
                  var l = o.insect();
                  return r[0].setPoints(l[0], t[0]), r[1].setPoints(l[1], t[0]), i = r[0].getDistance() < r[1].getDistance() ? l[0] : l[1]
                }, CirOneDeviation: function (t, e) {
                  for (var i = Object.create(a.prototype), n = Object.create(Array.prototype),
                         o = Object.create(p.prototype), r = Object.create(Array.prototype),
                         s = 0; s < 2; s++)n[s] = Object.create(c.prototype), r[s] = Object.create(h.prototype);
                  n[0].setCircle(t[0], e[0]), n[1].setCircle(t[2], e[2]), o.setCircles(n[0], n[1]);
                  var l = o.insect();
                  return r[0].setPoints(l[0], t[1]), r[1].setPoints(l[1], t[1]), i = r[0].getDistance() < r[1].getDistance() ? l[0] : l[1]
                }, CirTwoDeviation: function (t, e) {
                  for (var i = Object.create(a.prototype), n = Object.create(Array.prototype),
                         o = Object.create(p.prototype), r = Object.create(Array.prototype),
                         s = 0; s < 2; s++)n[s] = Object.create(c.prototype), r[s] = Object.create(h.prototype);
                  n[0].setCircle(t[0], e[0]), n[1].setCircle(t[1], e[1]), o.setCircles(n[0], n[1]);
                  var l = o.insect();
                  return r[0].setPoints(l[0], t[2]), r[1].setPoints(l[1], t[2]), i = r[0].getDistance() < r[1].getDistance() ? l[0] : l[1]
                }, CirOneTwoDeviation: function (t, e) {
                  for (var i = Object.create(a.prototype), n = Object.create(Array.prototype),
                         o = Object.create(Array.prototype), r = Object.create(Array.prototype),
                         s = Object.create(Array.prototype), l = Object.create(Array.prototype),
                         u = 0; u < 2; u++)n[u] = Object.create(a.prototype), r[u] = Object.create(p.prototype), s[u] = Object.create(h.prototype);
                  for (u = 0; u < 3; u++)o[u] = Object.create(c.prototype);
                  for (u = 0; u < 4; u++)l[u] = Object.create(h.prototype);
                  return o[0].setCircle(t[0], e[0]), o[1].setCircle(t[1], e[1]), o[2].setCircle(t[2], e[2]), r[0].setCircles(o[0], o[1]), r[1].setCircles(o[0], o[2]), s[0] = r[0].insect(), s[1] = r[1].insect(), l[0].setPoints(s[0][0], t[2]), l[1].setPoints(s[0][1], t[2]), l[2].setPoints(s[1][0], t[1]), l[3].setPoints(s[1][1], t[1]), l[0].getDistance() < l[1].getDistance() ? n[0] = s[0][0] : n[0] = s[0][1], l[2].getDistance() < l[3].getDistance() ? n[1] = s[1][0] : n[1] = s[1][1], i.setPoint((n[0].x + n[1].x) / 2, (n[0].y + n[1].y) / 2), i
                }, CirZeroTwoDeviation: function (t, e) {
                  for (var i = Object.create(a.prototype), n = Object.create(Array.prototype),
                         o = Object.create(Array.prototype), r = Object.create(Array.prototype),
                         s = Object.create(Array.prototype), l = Object.create(Array.prototype),
                         u = 0; u < 2; u++)n[u] = Object.create(a.prototype), r[u] = Object.create(p.prototype), s[u] = Object.create(h.prototype);
                  for (u = 0; u < 3; u++)o[u] = Object.create(c.prototype);
                  for (u = 0; u < 4; u++)l[u] = Object.create(h.prototype);
                  return o[0].setCircle(t[0], e[0]), o[1].setCircle(t[1], e[1]), o[2].setCircle(t[2], e[2]), r[0].setCircles(o[0], o[1]), r[1].setCircles(o[1], o[2]), s[0] = r[0].insect(), s[1] = r[1].insect(), l[0].setPoints(s[0][0], t[2]), l[1].setPoints(s[0][1], t[2]), l[2].setPoints(s[1][0], t[0]), l[3].setPoints(s[1][1], t[0]), l[0].getDistance() < l[1].getDistance() ? n[0] = s[0][0] : n[0] = s[0][1], l[2].getDistance() < l[3].getDistance() ? n[1] = s[1][0] : n[1] = s[1][1], i.setPoint((n[0].x + n[1].x) / 2, (n[0].y + n[1].y) / 2), i
                }, CirZeroOneDeviation: function (t, e) {
                  for (var i = Object.create(a.prototype), n = Object.create(Array.prototype),
                         o = Object.create(Array.prototype), r = Object.create(Array.prototype),
                         s = Object.create(Array.prototype), l = Object.create(Array.prototype),
                         u = 0; u < 2; u++)n[u] = Object.create(a.prototype), r[u] = Object.create(p.prototype), s[u] = Object.create(h.prototype);
                  for (u = 0; u < 3; u++)o[u] = Object.create(c.prototype);
                  for (u = 0; u < 4; u++)l[u] = Object.create(h.prototype);
                  return o[0].setCircle(t[0], e[0]), o[1].setCircle(t[1], e[1]), o[2].setCircle(t[2], e[2]), r[0].setCircles(o[0], o[2]), r[1].setCircles(o[1], o[2]), s[0] = r[0].insect(), s[1] = r[1].insect(), l[0].setPoints(s[0][0], t[1]), l[1].setPoints(s[0][1], t[1]), l[2].setPoints(s[1][0], t[0]), l[3].setPoints(s[1][1], t[0]), l[0].getDistance() < l[1].getDistance() ? n[0] = s[0][0] : n[0] = s[0][1], l[2].getDistance() < l[3].getDistance() ? n[1] = s[1][0] : n[1] = s[1][1], i.setPoint((n[0].x + n[1].x) / 2, (n[0].y + n[1].y) / 2), i
                }
              }, d = Object.create(m.prototype), f = u[s](t, e);
              return d.locationFilter(t, f)
            }, s = {
              beaconNumEqualOne: function (t, e, i) {
                var n, o = Object.create(a.prototype), r = t.keyArray()[0];
                o.setPoint(e.get(r).x, e.get(r).y), n = t.get(r).distance, console.log(o, n), i.features[0].properties.floor_id = e.get(r).floorId, i.features[0].geometry.coordinate[0] = e.get(r).x, i.features[0].geometry.coordinate[1] = e.get(r).y, console.log("BeaconNum = 1")
              }, beaconNumEqualTwo: function (t, e, i) {
                for (var n, o = 2, r = Object.create(Array.prototype), s = Object.create(Array.prototype),
                       h = Object.create(Array.prototype), l = Object.create(Array.prototype), u = 0, c = 0, p = 0,
                       d = 0; d < o; d++)r[d] = Object.create(a.prototype);
                var f = t.keyArray();
                for (d = 0; d < o; d++)h[d] = f[d], s[d] = Number(t.get(h[d]).distance), r[d].setPoint(e.get(h[d]).x, e.get(h[d]).y);
                for (d = 0; d < o; d++)console.log(r[d], s[d]);
                for (n = s[M.DIS_A] < s[M.DIS_B] ? 0 : 1, d = 0; d < o; ++d)u += 1 / s[d];
                for (d = 0; d < o; ++d)l[d] = 1 / s[d] / u;
                for (console.log(l), d = 0; d < o; ++d)c += l[d] * r[d].x, p += l[d] * r[d].y;
                i.features[0].properties.floor_id = e.get(h[n]).floorId, i.features[0].geometry.coordinate[0] = c, i.features[0].geometry.coordinate[1] = p, console.log("BeaconNum = 2")
              }, beaconNumEqualThree: function (t, e, i) {
                for (var n = 3, o = Object.create(Array.prototype), s = Object.create(Array.prototype),
                       h = Object.create(Array.prototype), l = new Array(3),
                       u = 0; u < n; u++)o[u] = Object.create(a.prototype);
                var c = t.keyArray();
                for (u = 0; u < n; u++)h[u] = c[u], s[u] = Number(t.get(h[u]).distance), o[u].setPoint(e.get(h[u]).x, e.get(h[u]).y), l[u] = e.get(h[u]).floorId;
                for (u = 0; u < n; u++)console.log(o[u], s[u]);
                var p = r(o, s);
                l.sort(_.sortRule), i.features[0].properties.floor_id = l[(n + 1) / 2 - 1], i.features[0].geometry.coordinate[0] = p.x, i.features[0].geometry.coordinate[1] = p.y, console.log("BeaconNum = 3")
              }, beaconNumMoreThanThree: function (t, e, i) {
                for (var n = t.size(), o = new Array(n), s = Object.create(Array.prototype),
                       h = Object.create(Array.prototype), l = Object.create(Array.prototype), u = new Array(3),
                       c = 0; c < M.BEACON_USE_NUM; c++)s[c] = Object.create(a.prototype);
                var p = t.keyArray();
                for (c = 0; c < n; c++)o[c] = Number(t.get(p[c]).distance);
                for (o.sort(_.sortRule), c = 0; c < M.BEACON_USE_NUM; c++)for (var d = 0; d < t.size(); d++) {
                  var f = t.get(p[d]);
                  if (f && f.distance && f.distance == o[c]) {
                    h[c] = p[d], s[c].setPoint(e.get(h[c]).x, e.get(h[c]).y), l[c] = Number(t.get(h[c]).distance), u[c] = e.get(h[c]).floorId;
                    break
                  }
                }
                for (c = 0; c < 3; c++)console.log(s[c], l[c]);
                var m = r(s, l);
                u.sort(_.sortRule), i.features[0].properties.floor_id = u[(Number(M.BEACON_USE_NUM) + 1) / 2 - 1], i.features[0].geometry.coordinate[0] = m.x, i.features[0].geometry.coordinate[1] = m.y, console.log("BeaconNum > 3")
              }
            };
            s[o](e, i, n)
          }
        };
        x.prototype.init = function (t) {
          this.BeaconsCfg = t
        }, x.prototype.locate = function (t) {
          var e, n, o, r, s, a, h = Object.create(g.prototype), l = Object.create(_.prototype),
            u = Object.create(m.prototype), c = new i, p = new i;
          if (u.setBoundaries(this.config), o = h.parseInfo(this.BeaconsCfg), e = h.parseInfo(t), r = o.BeaconsCfgArray.length, n = e.BeaconsArray.length, 0 == r)return console.warn("beaconsCfg is empty!"), 1;
          for (var y = 0; y < r; y++) {
            var v, L;
            "atten" in o.BeaconsCfgArray[y] && "lossCoe" in o.BeaconsCfgArray[y] ? (v = o.BeaconsCfgArray[y].atten, L = o.BeaconsCfgArray[y].lossCoe) : (v = -59, L = 2);
            var M = new d(o.BeaconsCfgArray[y].beaconId, o.BeaconsCfgArray[y].mapId, o.BeaconsCfgArray[y].sceneId, o.BeaconsCfgArray[y].floorId, o.BeaconsCfgArray[y].uuid, o.BeaconsCfgArray[y].major, o.BeaconsCfgArray[y].minor, Number(o.BeaconsCfgArray[y].geom.x), Number(o.BeaconsCfgArray[y].geom.y), v, L),
              w = new String(o.BeaconsCfgArray[y].uuid + o.BeaconsCfgArray[y].major + o.BeaconsCfgArray[y].minor);
            c.put(w, M)
          }
          if (c.isEmpty())return console.log("BeaconCfgNum = 0"), 1;
          if (0 == n)return console.warn("beacons is empty!"), 1;
          for (y = 0; y < n; y++) {
            var C = new String(e.BeaconsArray[y].uuid + e.BeaconsArray[y].major + e.BeaconsArray[y].minor);
            if (c.containsKey(C)) {
              var x = 0;
              if ("distance" in e.BeaconsArray[y] ? u.distanceFilter(e.BeaconsArray[y].distance) && (x = e.BeaconsArray[y].distance) : u.rssiFilter(Number(e.BeaconsArray[y].rssi), c.get(C).atten) && (x = l.calcDistByRssi(Number(e.BeaconsArray[y].rssi), c.get(C).atten, c.get(C).lossCoe)), x) {
                var D = new f(e.BeaconsArray[y].uuid, e.BeaconsArray[y].major, e.BeaconsArray[y].minor, x);
                p.put(C, D)
              }
            }
          }
          return p.isEmpty() ? (console.warn("BeaconNum = 0"), 1) : (a = p.size(), c.isEmpty() || p.isEmpty() ? (console.warn("beaconsCfgMap or beaconsMap is empty!"), 1) : (this.bleLocationStrategy(a, p, c, this.bleLocationInfoInstance), p.clear(), c.clear(), console.info(this.bleLocationInfoInstance.features[0].properties), console.info(this.bleLocationInfoInstance.features[0].geometry.coordinate), s = h.stringifyInfo(this.bleLocationInfoInstance)))
        }, x.prototype.getBleLocationInfo = function () {
          var t = Object.create(g.prototype);
          return t.stringifyInfo(this.bleLocationInfoInstance)
        }, "object" == typeof e && "object" == typeof e.exports ? e.exports = x : "function" == typeof define && define.amd ? define(x) : t.BleLocationEngine = x
      }(window)
    }, {}]
  }, {}, [14])(14)
})();
